*/
public class NodeInstanceFactory {
public static NodeInstance newNodeInstance(ProcessInstance processInstance, Node node){
if(node instanceof StartEventNode){
StartEventNodeInstance startEvent = new StartEventNodeInstance();
startEvent.setProcessInstance(processInstance);
startEvent.setNode(node);
return startEvent;
}
if(node instanceof ActionNode){
ActionNodeInstance actionNode = new ActionNodeInstance(((ActionNode)node).getAction());
actionNode.setProcessInstance(processInstance);