Package org.jbpm.pvm

Examples of org.jbpm.pvm.Execution


        .node("wire the money").behaviour(new Display("automatic payment"))
          .transition().to("end")
        .node("end").behaviour(new WaitState())
    .done();
   
    Execution execution = processDefinition.startExecution();
    assertEquals("accept loan request", execution.getNode().getName());
    execution.signal();
    assertEquals("loan evaluation", execution.getNode().getName());
    execution.signal("approve");
    assertEquals("end", execution.getNode().getName());
   
    execution = processDefinition.startExecution();
    assertEquals("accept loan request", execution.getNode().getName());
    execution.signal();
    assertEquals("loan evaluation", execution.getNode().getName());
    execution.signal("reject");
    assertEquals("end", execution.getNode().getName());
  }
View Full Code Here


        .node("b").behaviour(new WaitState())
          .event("node-enter")
            .listener(new Display("entering b"))
    .done();

    Execution execution = processDefinition.startExecution();
    execution.signal();
  }
View Full Code Here

*/
public abstract class AbstractCommand implements Command {
 
  protected Execution getExecution(Environment environment, long executionId) {
    DbSession dbSession = environment.get(DbSession.class);
    Execution execution = dbSession.get(ExecutionImpl.class, executionId);
    if (execution==null) {
      throw new CommandException("execution "+executionId+" doesn't exist");
    }
    return execution;
  }
View Full Code Here

    this.signalName = signalName;
    this.parameters = parameters;
  }

  public Object execute(Environment environment) throws Exception {
    Execution execution = environment.get(PvmDbSession.class).get(ExecutionImpl.class, executionDbid);
    execution.signal(signalName, parameters);
    return execution;
  }
View Full Code Here

    this.executionId = executionId;
    addVariable(key, variable);
  }

  public Object execute(Environment environment) throws Exception {
    Execution execution = getExecution(environment, executionId);
    execution.setVariables(variables);
    return execution;
  }
View Full Code Here

    this.executionDbid = executionDbid;
    this.variableName = variableName;
  }

  public Object execute(Environment environment) throws Exception {
    Execution execution = environment.get(PvmDbSession.class).get(ExecutionImpl.class, executionDbid);
    return execution.getVariable(variableName);
  }
View Full Code Here

    this.executionDbid = executionDbid;
    this.variableNames = variableNames;
  }

  public Object execute(Environment environment) throws Exception {
    Execution execution = environment.get(PvmDbSession.class).get(ExecutionImpl.class, executionDbid);
   
    Map<String, Object> variables = new HashMap<String, Object>();
    for (String variableName : variableNames) {
      Object value = execution.getVariable(variableName);
      variables.put(variableName, value);
    }

    return variables;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.Execution

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.