Package org.jbpm.taskmgmt.exe

Examples of org.jbpm.taskmgmt.exe.TaskMgmtInstance


    }
    else
    {
      ContextInstance contextInstance = executionContext.getContextInstance();
      TaskMgmtInstance taskMgmtInstance = executionContext.getTaskMgmtInstance();
      Token token = executionContext.getToken();

      if ((contextInstance != null) && (contextInstance.hasVariable(name, token)))
      {
        value = contextInstance.getVariable(name, token);
      }
      else if ((contextInstance != null) && (contextInstance.hasTransientVariable(name)))
      {
        value = contextInstance.getTransientVariable(name);
      }
      else if ((taskMgmtInstance != null) && (taskMgmtInstance.getSwimlaneInstances() != null) && (taskMgmtInstance.getSwimlaneInstances().containsKey(name)))
      {
        SwimlaneInstance swimlaneInstance = taskMgmtInstance.getSwimlaneInstance(name);
        value = (swimlaneInstance != null ? swimlaneInstance.getActorId() : null);

      }
      else if (JbpmConfiguration.Configs.hasObject(name))
      {
View Full Code Here


            // 2. If the root token is still at the start state, and
            // 3. If the start state has a default leaving transition, then
            // signal the token along the default transition.
            context.addSuccessMessage("Started process");

            final TaskMgmtInstance taskMgmtInstance = instance.getTaskMgmtInstance();
            final TaskInstance startTaskInstance = taskMgmtInstance.createStartTaskInstance();

            /* next piece causes NPE.
             * and i don't think it is needed to signal a new process automatically.  that can
             * be done in the console itself as well. 
             * TODO it would be nice if the console automatically navigated to the screen where
View Full Code Here

  // node behaviour methods
  /////////////////////////////////////////////////////////////////////////////
 
  public void execute(ExecutionContext executionContext) {
   
    TaskMgmtInstance tmi = getTaskMgmtInstance(executionContext.getToken());
   
    // if this tasknode should create instances
    if ( (createTasks)
         && (tasks!=null) ) {
      for (Task task : tasks) {
        executionContext.setTask(task);
        if (evaluateTaskCondition(task.getCondition(), executionContext)) {
          tmi.createTaskInstance(task, executionContext);
        }       
      }
    }

    // check if we should continue execution
    boolean continueExecution;
    switch (signal) {
      case SIGNAL_UNSYNCHRONIZED:
        continueExecution = true;
        break;
      case SIGNAL_FIRST:
      case SIGNAL_LAST:
        continueExecution = tmi.getSignallingTasks(executionContext).isEmpty();
        break;
      default:
        continueExecution = false;
    }
View Full Code Here

    }
    return false;
  }

  public void leave(ExecutionContext executionContext, Transition transition) {
    TaskMgmtInstance tmi = getTaskMgmtInstance(executionContext.getToken());
    if (tmi.hasBlockingTaskInstances(executionContext.getToken()) ) {
      throw new IllegalStateException("task-node '"+name+"' still has blocking tasks");
    }
    removeTaskInstanceSynchronization(executionContext.getToken());
    super.leave(executionContext, transition);
  }
View Full Code Here

    return completionTriggersSignal;
  }

  boolean isLastToComplete(TaskInstance taskInstance) {
    Token token = taskInstance.getToken();
    TaskMgmtInstance tmi = getTaskMgmtInstance(token);
   
    boolean isLastToComplete = true;
    for (TaskInstance other : tmi.getTaskInstances()) {
      if ( (token!=null)
          && (token.equals(other.getToken()))
          && (! other.equals(taskInstance))
          && (other.isSignalling())
          && (!other.hasEnded())
View Full Code Here

   
    return isLastToComplete;
  }

  public void removeTaskInstanceSynchronization(Token token) {
    TaskMgmtInstance tmi = getTaskMgmtInstance(token);
    Collection<TaskInstance> taskInstances = tmi.getTaskInstances();
    if (taskInstances!=null) {
      for (TaskInstance taskInstance : taskInstances) {
        if (token.equals(taskInstance.getToken())) {
          // remove signalling
          if (taskInstance.isSignalling()) {
View Full Code Here

        // add a log
        parent.addLog(new TokenEndLog(this));
      }

      // if there are tasks associated to this token, remove signaling capabilities
      TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
      if (taskMgmtInstance != null)
      {
        taskMgmtInstance.removeSignalling(this);
      }

      if (verifyParentTermination)
      {
        // if this is the last active token of the parent,
View Full Code Here

    }
  }

  void suspendTaskInstances()
  {
    TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
    if (taskMgmtInstance != null)
    {
      taskMgmtInstance.suspend(this);
    }
  }
View Full Code Here

    }
  }

  void resumeTaskInstances()
  {
    TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
    if (taskMgmtInstance != null)
    {
      taskMgmtInstance.resume(this);
    }
  }
View Full Code Here

  private void addOneTask(Token token) {
    TaskMgmtDefinition tmd = (TaskMgmtDefinition) processDefinition.getDefinition(TaskMgmtDefinition.class);
    Task task = tmd.getTask("watch movie amadeus");
   
    TaskMgmtInstance tmi = token.getProcessInstance().getTaskMgmtInstance();
    tmi.createTaskInstance(task, token);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.taskmgmt.exe.TaskMgmtInstance

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.