Package org.jbpm.graph.exe

Examples of org.jbpm.graph.exe.Token


    // create the context and pass it on to the action
    ProcessInstance instance = processDefinition.createProcessInstance();
    // we have to use transient variables or otherwise HB will get in the way
    instance.getContextInstance().setTransientVariable(DummyActionHandler.TEST_LABEL,
        applicationContext.getBean("jbpmAction"));
    Token token = instance.getRootToken();

    delegate.execute(new ExecutionContext(token));
  }
View Full Code Here


    // create the context and pass it on to the action
    ProcessInstance instance = processDefinition.createProcessInstance();
    // we have to use transient variables or otherwise HB will get in the way
    instance.getContextInstance().setTransientVariable(DummyActionHandler.TEST_LABEL,
        applicationContext.getBean("jbpmAction"));
    Token token = instance.getRootToken();

    delegate.execute(new ExecutionContext(token));
  }
View Full Code Here

     */
    public void signalToken(final ProcessInstance processInstance, final String tokenName) {
    execute(new JbpmCallback() {

      public Object doInJbpm(JbpmContext context) {
        Token token = processInstance.getRootToken().findToken(tokenName);
                if (token == null) {
                    processInstance.signal();
                } else {
                    token.signal();
                }
                return null;
      }
    });
  }
View Full Code Here

     */
    public void signalToken(final ProcessInstance processInstance, final String tokenName, final String transitionId) {
    execute(new JbpmCallback() {

      public Object doInJbpm(JbpmContext context) {
        Token token = processInstance.getRootToken().findToken(tokenName);
                if (token == null) {
                    processInstance.signal(transitionId);
                } else {
                    token.signal(transitionId);
                }
                return null;
      }
    });
  }
View Full Code Here

  long processInstanceId = -1;
 
  public TimerInfo(Timer timer) {
    timerId = timer.getId();
    timerName = timer.getName();
    Token token = timer.getToken();
    tokenId = (token!=null ? token.getId() : -1);
    ProcessInstance processInstance = timer.getProcessInstance();
    processInstanceId = (processInstance!=null ? processInstance.getId() : -1);
  }
View Full Code Here

  @Override
  public BpmActivity[] getCurrentActivities() {
    HashSet<BpmActivity> out = new HashSet<BpmActivity>();
   
    Token root = processInstance.getRootToken();
   
    out.add(new JBpmActivity(this, root.getNode() ) );
    return out.toArray(new BpmActivity[out.size()]);
  }
View Full Code Here

    if (getStatus() != STATUS.ACTIVE)
      throw new BpmException(this,"instance is not active");
   
    if (action != null) {
      // check
      Token root = processInstance.getRootToken();
      if (!action.equals(root.getNode().getName()))
        throw new BpmException(this,"action is not current " + action);
    }
   
    ContextInstance contextInstance = processInstance.getContextInstance();
    if (parameters != null) contextInstance.setVariables(parameters);
View Full Code Here

    if (name == null) processInstance.signal(); else processInstance.signal(name);
  }

  public void setActivity(String activity) {
    // workflow.getProcessDefinition().findNode(activity);
    Token token = processInstance.getRootToken();
    for (Object tokenObj : processInstance.findAllTokens() ) {
      token = (Token)tokenObj;
      if (token.getNode().getName().equals(activity)) break;
    }
    processInstance.setRootToken(token);
  }
View Full Code Here

  }

  public Object execute(JbpmContext jbpmContext) throws Exception
  {
    this.jbpmContext = jbpmContext;
    Token token = jbpmContext.loadTokenForUpdate(tokenId);

    // create a token local process variable to indicate this token was canceled
    token.getProcessInstance().getContextInstance().createVariable(
        CANCELLATION_INDICATOR_VARIABLE_NAME, Clock.getCurrentTime(), token);

    cancelToken(token);   
    this.jbpmContext = null;
    return null;
View Full Code Here

      if (taskControllerDelegation != null) {
        TaskControllerHandler taskControllerHandler = (TaskControllerHandler) taskControllerDelegation.instantiate();
        ProcessInstance processInstance = taskInstance.getTaskMgmtInstance().getProcessInstance();
        ContextInstance contextInstance = (processInstance != null ? processInstance.getContextInstance() : null);
        Token token = taskInstance.getToken();

        if (UserCodeInterceptorConfig.userCodeInterceptor != null) {
          UserCodeInterceptorConfig.userCodeInterceptor.executeTaskControllerInitialization(taskControllerHandler, taskInstance, contextInstance, token);
        } else {
          taskControllerHandler.initializeTaskVariables(taskInstance, contextInstance, token);
        }

      } else {
        Token token = taskInstance.getToken();
        ProcessInstance processInstance = token.getProcessInstance();
        ContextInstance contextInstance = processInstance.getContextInstance();

        if (variableAccesses != null) {
          for (VariableAccess variableAccess : variableAccesses) {
            String mappedName = variableAccess.getMappedName();
View Full Code Here

TOP

Related Classes of org.jbpm.graph.exe.Token

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.