Package org.kie.api.runtime.process

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



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

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

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

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

public class StateBasedActivitySimulator implements ActivitySimulator {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
       NodeInstance stateNode = (NodeInstance) activity;
       long startTime = context.getClock().getCurrentTime();
       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();
      
       TimeGenerator timeGenerator=TimeGeneratorFactory.newTimeGenerator(provider.getSimulationDataForNode(node));
       long duration = timeGenerator.generateTime();
View Full Code Here

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

public class EndEventSimulator implements ActivitySimulator {

    public SimulationEvent simulate(Object activity, SimulationContext context) {
        NodeInstance nodeInstance = (NodeInstance) activity;
        long startTime = context.getClock().getCurrentTime();
        ProcessInstance pi = nodeInstance.getProcessInstance();
       
        Node node = nodeInstance.getNode();
        String bpmn2NodeId = (String) node.getMetaData().get("UniqueId");
       
        String processName = pi.getProcessName();
        String processVer = pi.getProcess().getVersion();
        if (processVer == null) {
View Full Code Here

                    boundaryEventNode = node;
                    break;
                }
            }
            if (boundaryEventNode != null) {
                NodeInstance next = ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(boundaryEventNode);
                setNodeId(boundaryEventNode.getId());
                this.trigger(next, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
            }
        }
        setNodeId(currentNodeId);
View Full Code Here

        for (Node node: compositeNode.getNodes()) {
            if (node instanceof StartNode) {
                StartNode startNode = (StartNode) node;
                if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) {
                    NodeInstance nodeInstance = getNodeInstance(startNode);
                    ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, null);

                }
            }
        }
View Full Code Here

                        boundaryEventNode = node;
                        break;
                    }
                }
                if (boundaryEventNode != null) {
                    NodeInstance next = ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(boundaryEventNode);
                    setNodeId(boundaryEventNode.getId());
                    this.trigger(next, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
                }
            }
            setNodeId(currentNodeId);
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.process.NodeInstance

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.