Examples of NodeInstance


Examples of org.jbpm.workflow.instance.NodeInstance

              ForEachNodeInstance.this.triggerCompleted(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, true);
            } else {
              List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>();
              for (Object o: collection) {
                String variableName = getForEachNode().getVariableName();
                NodeInstance nodeInstance = (NodeInstance)
                ((NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getForEachSplitNode().getTo().getTo());
                VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                  nodeInstance.resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName);
                variableScopeInstance.setVariable(variableName, o);
                nodeInstances.add(nodeInstance);
              }
              for (NodeInstance nodeInstance: nodeInstances) {
                ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(this, getForEachSplitNode().getTo().getToType());
View Full Code Here

Examples of org.jbpm.workflow.instance.NodeInstance

    Collection<NodeInstance> result = nodeInstances;
    if (recursive) {
      result = new ArrayList<NodeInstance>(result);
      for (Iterator<NodeInstance> iterator = nodeInstances.iterator(); iterator
          .hasNext();) {
        NodeInstance nodeInstance = iterator.next();
        if (nodeInstance instanceof NodeInstanceContainer) {
          result
              .addAll(((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstance)
                  .getNodeInstances(true));
        }
View Full Code Here

Examples of org.jbpm.workflow.instance.NodeInstance

  }

  public NodeInstance getFirstNodeInstance(final long nodeId) {
    for (final Iterator<NodeInstance> iterator = this.nodeInstances
        .iterator(); iterator.hasNext();) {
      final NodeInstance nodeInstance = iterator.next();
      if (nodeInstance.getNodeId() == nodeId) {
        return nodeInstance;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.jbpm.workflow.instance.NodeInstance

  public List<NodeInstance> getNodeInstances(final long nodeId) {
    List<NodeInstance> result = new ArrayList<NodeInstance>();
    for (final Iterator<NodeInstance> iterator = this.nodeInstances
        .iterator(); iterator.hasNext();) {
      final NodeInstance nodeInstance = iterator.next();
      if (nodeInstance.getNodeId() == nodeId) {
        result.add(nodeInstance);
      }
    }
    return result;
  }
View Full Code Here

Examples of org.jbpm.workflow.instance.NodeInstance

      InternalKnowledgeRuntime kruntime = getKnowledgeRuntime();
      InternalProcessRuntime processRuntime = (InternalProcessRuntime) kruntime.getProcessRuntime();
      processRuntime.getProcessEventSupport().fireBeforeProcessCompleted(this, kruntime);
      // deactivate all node instances of this process instance
      while (!nodeInstances.isEmpty()) {
        NodeInstance nodeInstance = nodeInstances.get(0);
        ((org.jbpm.workflow.instance.NodeInstance) nodeInstance)
            .cancel();
      }
      removeEventListeners();
      processRuntime.getProcessInstanceManager().removeProcessInstance(this);
View Full Code Here

Examples of org.jbpm.workflow.instance.NodeInstance

        }
      }
      if (((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic()) {
        for (Node node : getWorkflowProcess().getNodes()) {
          if (type.equals(node.getName()) && node.getIncomingConnections().isEmpty()) {
              NodeInstance nodeInstance = getNodeInstance(node);
                    ((org.jbpm.workflow.instance.NodeInstance) nodeInstance)
                      .trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE);
            }
        }
      }
View Full Code Here

Examples of org.kie.api.runtime.process.NodeInstance

import org.kie.api.runtime.process.ProcessInstance;

public class EventSimulator implements ActivitySimulator  {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
        NodeInstance eventNodeInstance = (NodeInstance) activity;
        long startTime = context.getClock().getCurrentTime();
        Map<String, Object> metadata = eventNodeInstance.getNode().getMetaData();
       
        ProcessInstance pi = eventNodeInstance.getProcessInstance();
        Node node = eventNodeInstance.getNode();
        String bpmn2NodeId = (String) metadata.get("UniqueId");
        SimulationDataProvider provider = context.getDataProvider();
       
        TimeGenerator timeGenerator=TimeGeneratorFactory.newTimeGenerator(provider.getSimulationDataForNode(node));
        long duration = timeGenerator.generateTime();
View Full Code Here

Examples of org.kie.api.runtime.process.NodeInstance


public class GatewaySimulator implements ActivitySimulator {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
        NodeInstance gateway = (NodeInstance) activity;
        long startTime = context.getClock().getCurrentTime();
        Map<String, Object> metadata = gateway.getNode().getMetaData();
       
        ProcessInstance pi = gateway.getProcessInstance();
        Node node = gateway.getNode();
        String bpmn2NodeId = (String) metadata.get("UniqueId");
        // todo
        long duration = 0;
       
        long endTime = startTime + duration;
View Full Code Here

Examples of org.kie.api.runtime.process.NodeInstance

import org.kie.api.runtime.process.ProcessInstance;

public class StartEventSimulator implements ActivitySimulator {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
        NodeInstance nodeInstance = (NodeInstance) activity;
       
        ProcessInstance pi = nodeInstance.getProcessInstance();

        context.setStartTime(context.getClock().getCurrentTime());
        Node node = nodeInstance.getNode();
        String bpmn2NodeId = (String) node.getMetaData().get("UniqueId");

        // set end time for processinstance end time
        context.setMaxEndTime(context.getClock().getCurrentTime());
       
View Full Code Here

Examples of org.kie.api.runtime.process.NodeInstance

public class HumanTaskActivitySimulator implements ActivitySimulator {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
        long startTime = context.getClock().getCurrentTime();
        NodeInstance stateNode = (NodeInstance) activity;
       
        Map<String, Object> metadata = stateNode.getNode().getMetaData();
       
        ProcessInstance pi = stateNode.getProcessInstance();
        Node node = stateNode.getNode();
        String bpmn2NodeId = (String) metadata.get("UniqueId");
        SimulationDataProvider provider = context.getDataProvider();
        Map<String, Object> properties = provider.getSimulationDataForNode(node);
       
        TimeGenerator timeGenerator=TimeGeneratorFactory.newTimeGenerator(properties);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.