Package org.jbpm.graph.exe

Examples of org.jbpm.graph.exe.ExecutionContext


    // phase three: launch child tokens from the fork over the given transitions
    for (Map.Entry<String, Token> forkedToken : forkedTokens.entrySet()) {
      Token childToken = forkedToken.getValue();
      String leavingTransitionName = forkedToken.getKey();
      ExecutionContext childExecutionContext = new ExecutionContext(childToken);
      if (leavingTransitionName!=null) {
        leave(childExecutionContext, leavingTransitionName);
      } else {
        leave(childExecutionContext);
      }     
View Full Code Here


        }       
      }
     
      if ( reactivate ) {
        for (Token concurrentToken : concurrentTokens) {
          mergeNode.leave(new ExecutionContext(concurrentToken));         
        }
      }
    }
  }
View Full Code Here

    // register process instance for automatic save
    // see https://jira.jboss.org/jira/browse/JBPM-1015
    jbpmContext.addAutoSaveProcessInstance(processInstance);

    // prepare execution context
    ExecutionContext executionContext = new ExecutionContext(token);
    executionContext.setTimer(this);
    if (taskInstance != null) executionContext.setTaskInstance(taskInstance);

    // first fire the event if there is a graph element specified
    if (graphElement != null) {
      graphElement.fireAndPropagateEvent(Event.EVENTTYPE_TIMER, executionContext);
    }
View Full Code Here

          // write to all child tokens that the parent is already reactivated
          for (Token child : parentToken.getChildren().values()) {
            child.setAbleToReactivateParent(false);
          }
          // write to all child tokens that the parent is already reactivated
          ExecutionContext parentContext = new ExecutionContext(parentToken);
          leave(parentContext);
        }
      }
    }
  }
View Full Code Here

    // register process instance for automatic save
    // see https://jira.jboss.org/jira/browse/JBPM-1015
    jbpmContext.addAutoSaveProcessInstance(processInstance);

    // prepare execution context
    ExecutionContext executionContext = new ExecutionContext(token);
    executionContext.setAction(action);
    executionContext.setEvent(action.getEvent());

    // then execute the action
    Node node = token != null ? token.getNode() : null;
    if (node != null) {
      node.executeAction(action, executionContext);
View Full Code Here

    jbpmContext.addAutoSaveProcessInstance(processInstance);

    // unlock token in case it leaves the node
    token.unlock(this.toString());
    // prepare execution context
    ExecutionContext executionContext = new ExecutionContext(token);
    // then execute the node
    node.execute(executionContext);

    return true;
  }
View Full Code Here

 
  public void testExecute() {
    ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition();
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Token token = processInstance.getRootToken();
    ExecutionContext executionContext = new ExecutionContext(token);
    ContextInstance contextInstance = executionContext.getContextInstance();
    contextInstance.setVariable("a", new Integer(1));
    contextInstance.setVariable("b", new Integer(1));
   
    Script script = new Script();
    script.addVariableAccess(new VariableAccess("a", "read,write", null));
View Full Code Here

  ExecutionContext executionContext = null;
 
  public void setUp() {
    ProcessDefinition processDefinition = new ProcessDefinition();
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    executionContext = new ExecutionContext(processInstance.getRootToken());
  }
View Full Code Here

    ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition();
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Token token = processInstance.getRootToken();
   
    Script script = new Script();
    ExecutionContext executionContext = new ExecutionContext(token);
    Map inputMap = script.createInputMap(executionContext);
    assertSame( executionContext, inputMap.get("executionContext"));
    assertSame( token, inputMap.get("token"));
    assertNull( inputMap.get("node"));
    assertNull( inputMap.get("task"));
View Full Code Here

    contextInstance.setVariable("a", new Integer(1) );
    contextInstance.setVariable("b", new Integer(1) );
    contextInstance.setVariable("c", new Integer(1) );
   
    Script script = new Script();
    Map inputMap = script.createInputMap(new ExecutionContext(token));
    assertEquals(new Integer(1), inputMap.get("a"));
    assertEquals(new Integer(1), inputMap.get("b"));
    assertEquals(new Integer(1), inputMap.get("c"));
  }
View Full Code Here

TOP

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

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.