Package org.jbpm.pvm.internal.model

Examples of org.jbpm.pvm.internal.model.ExecutionImpl


    ref.setId( e0.getId() );
    ref.setKey(e0.getKey());
    ref.setDefinitionId(e0.getProcessDefinition().getId() );
    ref.setStartDate( new Date() );                   // TODO: FIXME

    ExecutionImpl topLevelExecution = e0.getProcessInstance();
    TokenReference tok = execution2TokenReference(topLevelExecution);

    Collection<ExecutionImpl> childExecutions = (Collection)topLevelExecution.getExecutions();
    if(childExecutions!=null)
    {
      for(ExecutionImpl childExecution : childExecutions)
      {
        TokenReference childTok = execution2TokenReference(childExecution);
View Full Code Here


    tok.setCurrentNodeName( topLevelExecution.getActivityName() );

    // transitions
    List<String> availableSignals = new ArrayList<String>();

    ExecutionImpl openTopLevelExecution = (ExecutionImpl) topLevelExecution;
    List<Transition> outTransitions = openTopLevelExecution.getActivity().getOutgoingTransitions();
    if(outTransitions!=null) // crappy jBPM API
    {
      for(Transition t : outTransitions)
      {
        // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
View Full Code Here

    task.setAssignee( t0.getAssignee() );

    TaskImpl cast = ((TaskImpl) t0);
    task.setSignalling( cast.isSignalling());

    ExecutionImpl execution = cast.getProcessInstance();
    task.setProcessInstanceId( cast.getProcessInstance().getId() );

    // TODO: weird API
    task.setProcessId( execution.getProcessInstance().getProcessDefinition().getId() );

    // participations
    for(Participation p0 : cast.getParticipations())
    {
      if(p0.getType().equals(Participation.CANDIDATE))
View Full Code Here

    }

    public List<User> findUsersById(String... strings) {
        SortedSet<User> emails = new TreeSet<User>();
        try {
            ExecutionImpl execution = ((ExecutionContext)EnvironmentImpl.getCurrent().getContext("execution")).getExecution();
            WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
            String id = (String) execution.getVariable("nodeId");
            for (String userId : strings) {
                if (userId.equals("previousTaskAssignable")) {
                    JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
                    List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
                            execution.getActivity().getIncomingTransitions().get(0).getSource().getName(), execution.getProcessInstance().getId());
                    iterateOverPrincipals(emails, userId, principals);
                } else if (userId.equals("nextTaskAssignable")) {
                    JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
                    List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
                            execution.getActivity().getDefaultOutgoingTransition().getDestination().getName(), execution.getProcessInstance().getId());
                    iterateOverPrincipals(emails, userId, principals);
                } else if (userId.equals("currentWorkflowStarter")) {
                    String jahiaUser = (String) execution.getVariable("user");
                    JahiaUserManagerService service = ServicesRegistry.getInstance().getJahiaUserManagerService();
                    JahiaUser user = service.lookupUserByKey(jahiaUser);
                    addUser(emails, userId, user);
                } else if (userId.equals("jahiaSettingsProperty")) {
                    emails.add(new UserImpl(userId, "", "", SettingsBean.getInstance().getMail_from()));
View Full Code Here

    }

    @Override
    protected void fillRecipients(Execution execution, Message email) throws MessagingException {
        try {
            ExecutionImpl exe = (ExecutionImpl) execution;
            SortedSet<String> emails = new TreeSet<String>();
            AddressTemplate addressTemplate = getTemplate().getTo();
            String s = "";
            if (addressTemplate != null) {
                s = addressTemplate.getUsers();
View Full Code Here

  private static final long serialVersionUID = 1L;

  public void perform(ExecutionImpl execution) {
    ActivityImpl activity = execution.getActivity();
    ActivityImpl parentActivity = activity.getParentActivity();
    ExecutionImpl propagatingExecution = execution.endActivity(activity);
   
    propagatingExecution.setActivity(parentActivity);
    propagatingExecution.performAtomicOperation(new Signal(null, null));
  }
View Full Code Here

    this.activity = activity;
  }

  public void perform(ExecutionImpl execution) {
    execution.setActivity(activity);
    ExecutionImpl propagatingExecution = execution.startActivity(activity);
    propagatingExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
  }
View Full Code Here

    }
   
    Set<String> outcomes = new HashSet<String>();
    outcomes.add(Task.STATE_COMPLETED);

    ExecutionImpl execution = (task!=null ? task.getExecution() : null);
    ActivityImpl activity = (execution!=null ? execution.getActivity() : null);
    List<Transition> outgoingTransitions = (activity!=null ? activity.getOutgoingTransitions() : null);

    if (outgoingTransitions!=null) {
      for (Transition transition: outgoingTransitions) {
        outcomes.add(transition.getName());
View Full Code Here

  public static String initialise(TaskImpl task) {
    ProcessDefinitionImpl lifeCycle = getLifeCycle(task);
    Map<String, Object> lifeCycleVariables = new HashMap<String, Object>();
    lifeCycleVariables.put("task", task);
    ExecutionImpl lifeCycleExecution = (ExecutionImpl) lifeCycle.createProcessInstance();
    lifeCycleExecution.setVariables(lifeCycleVariables);
    lifeCycleExecution.start();
    return lifeCycleExecution.getActivity().getName();
  }
View Full Code Here

    }
    return lifeCycleProcess;
  }

  protected static void fireLifeCycleEvent(String eventName, TaskImpl task) {
    ExecutionImpl lifeCycleExecution = new ExecutionImpl();
    ProcessDefinitionImpl lifeCycleProcess = getLifeCycle(task);
    lifeCycleExecution.setProcessDefinition(lifeCycleProcess);
    String state = task.getState();
    Activity activity = lifeCycleProcess.getActivity(state);
    lifeCycleExecution.setActivity((ActivityImpl) activity);
    lifeCycleExecution.signal(eventName);
    task.setState(lifeCycleExecution.getActivity().getName());
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.model.ExecutionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.