public Object writeNodeInstance(MarshallerWriteContext context, NodeInstance nodeInstance) throws IOException { ObjectOutputStream stream = context.stream; stream.writeLong(nodeInstance.getId()); stream.writeLong(nodeInstance.getNodeId()); writeNodeInstanceContent(stream, nodeInstance, context); return null; }
private void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) { for (NodeInstance nodeInstance: nodeInstanceContainer.getNodeInstances()) { String oldNodeId = ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId(); Long newNodeId = nodeMapping.get(oldNodeId); if (newNodeId == null) { newNodeId = nodeInstance.getNodeId(); } ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId); if (nodeInstance instanceof NodeInstanceContainer) { updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping); } } }
break; case Join.TYPE_AND : Integer count = (Integer) this.triggers.get( from.getNodeId() ); if ( count == null ) { this.triggers.put( from.getNodeId(), 1 ); } else { this.triggers.put( from.getNodeId(), count.intValue() + 1 ); case Join.TYPE_DISCRIMINATOR : boolean triggerCompleted = triggers.isEmpty(); triggers.put( from.getNodeId(), new Integer( 1 ) ); if (checkAllActivated()) { resetAllTriggers(); count = (Integer) this.triggers.get( from.getNodeId() ); if ( count == null ) { this.triggers.put( from.getNodeId(), 1 ); } else { this.triggers.put( from.getNodeId(), count.intValue() + 1 );
public void afterNodeTriggered(org.kie.api.event.process.ProcessNodeTriggeredEvent event) { if ("Task2".equals(event.getNodeInstance().getNodeName())) { list.add(event.getNodeInstance().getNodeId()); } } });
private static void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) { for (NodeInstance nodeInstance : nodeInstanceContainer.getNodeInstances()) { String oldNodeId = ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId(); Long newNodeId = nodeMapping.get(oldNodeId); if (newNodeId == null) { newNodeId = nodeInstance.getNodeId(); } // clean up iteration levels for removed (old) nodes Map<String, Integer> iterLevels = ((WorkflowProcessInstanceImpl) nodeInstance.getProcessInstance()).getIterationLevels(); String uniqueId = (String) ((NodeImpl) nodeInstance.getNode()).getMetaData("UniqueId"); iterLevels.remove(uniqueId); // and now set to new node id ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId); if (nodeInstance instanceof NodeInstanceContainer) { updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping); } } }
private void initialize(NodeInstance nodeInstance, ProcessInstance processInstance) { this.processInstanceId = processInstance.getId(); this.processId = processInstance.getProcessId(); this.setDeploymentId(((ProcessInstanceImpl)processInstance).getDeploymentId()); if( nodeInstance != null ) { this.nodeInstanceId = nodeInstance.getId(); this.nodeId = nodeInstance.getNodeId(); if( ((ProcessInstanceImpl) processInstance).getKnowledgeRuntime() != null ) { this.nodeName = nodeInstance.getNodeName(); } } VariableScopeInstance variableScope = (VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance( VariableScope.VARIABLE_SCOPE ); // set input parameters if( variableScope != null ) { this.variables = variableScope.getVariables(); } else { this.variables = new HashMap<String, Object>(0); } }
Collection<Connection> incoming = getNode().getIncomingConnections(type); for (Connection conn : incoming) { if (conn.getFrom().getId() == from.getNodeId()) { this.metaData.put("IncomingConnection", conn.getMetaData().get("UniqueId")); break;
if ((connection.getFrom() instanceof CompositeNode.CompositeNodeStart) && (from == null || ((CompositeNode.CompositeNodeStart) connection.getFrom()).getInNode().getId() == from.getNodeId())) { NodeInstance nodeInstance = getNodeInstance(connection.getFrom()); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).trigger(null, nodeAndType.getType());
public JBPMMessages.ProcessInstance.NodeInstance writeNodeInstance(MarshallerWriteContext context, NodeInstance nodeInstance) throws IOException { JBPMMessages.ProcessInstance.NodeInstance.Builder _node = JBPMMessages.ProcessInstance.NodeInstance.newBuilder() .setId( nodeInstance.getId() ) .setNodeId( nodeInstance.getNodeId()) .setLevel(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getLevel()) .setSlaCompliance(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaCompliance()); if (((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaDueDate() != null) { _node.setSlaDueDate(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaDueDate().getTime()); } if (((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaTimerId() != null) { _node.setSlaTimerId(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaTimerId()); } _node.setContent( writeNodeInstanceContent( _node, nodeInstance, context ) ); return _node.build(); }
assertNotNull(triggeredBy); assertEquals(1, triggeredBy.size()); assertSame(startNode.getId(), triggeredBy.get(0).getNodeId());
public long getNodeId() { return delegate.getNodeId(); }
public Object writeNodeInstance(MarshallerWriteContext context, NodeInstance nodeInstance) throws IOException { ObjectOutputStream stream = context.stream; stream.writeLong(nodeInstance.getId()); stream.writeLong(nodeInstance.getNodeId()); writeNodeInstanceContent(stream, nodeInstance, context); return null; }
private void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) { for (NodeInstance nodeInstance: nodeInstanceContainer.getNodeInstances()) { String oldNodeId = ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId(); Long newNodeId = nodeMapping.get(oldNodeId); if (newNodeId == null) { newNodeId = nodeInstance.getNodeId(); } ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId); if (nodeInstance instanceof NodeInstanceContainer) { updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping); } } }
public void afterNodeTriggered(org.kie.api.event.process.ProcessNodeTriggeredEvent event) { if ("Task2".equals(event.getNodeInstance().getNodeName())) { list.add(event.getNodeInstance().getNodeId()); } } });
/** * Retrieve work item node definition. * * @param item work item instance * @return retrieve work item node definition */ private WorkItemNode getWorkItemNode(final WorkItem item) { final NodeInstance instance = getNodeInstance(item); final NodeInstanceContainer container = instance.getNodeInstanceContainer(); if (container instanceof RuleFlowProcessInstance) { final Node node = ((RuleFlowProcessInstance) container) .getRuleFlowProcess().internalGetNode(instance.getNodeId()); if (node instanceof WorkItemNode) { return ((WorkItemNode) node); } } return null; }
private static void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) { for (NodeInstance nodeInstance : nodeInstanceContainer.getNodeInstances()) { String oldNodeId = ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId(); Long newNodeId = nodeMapping.get(oldNodeId); if (newNodeId == null) { newNodeId = nodeInstance.getNodeId(); } // clean up iteration levels for removed (old) nodes Map<String, Integer> iterLevels = ((WorkflowProcessInstanceImpl) nodeInstance.getProcessInstance()).getIterationLevels(); String uniqueId = (String) ((NodeImpl) nodeInstance.getNode()).getMetaData("UniqueId"); iterLevels.remove(uniqueId); // and now set to new node id ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId); if (nodeInstance instanceof NodeInstanceContainer) { updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping); } } }
public NodeInstanceEvent(ProcessNodeEvent event) { this.nodeInstanceId = event.getNodeInstance().getId(); this.nodeName = event.getNodeInstance().getNodeName(); this.nodeId = event.getNodeInstance().getNodeId(); this.processInstanceId = event.getProcessInstance().getId(); }
public JBPMMessages.ProcessInstance.NodeInstance writeNodeInstance(MarshallerWriteContext context, NodeInstance nodeInstance) throws IOException { JBPMMessages.ProcessInstance.NodeInstance.Builder _node = JBPMMessages.ProcessInstance.NodeInstance.newBuilder() .setId( nodeInstance.getId() ) .setNodeId( nodeInstance.getNodeId()) .setLevel(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getLevel()) .setSlaCompliance(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaCompliance()); if (((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaDueDate() != null) { _node.setSlaDueDate(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaDueDate().getTime()); } if (((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaTimerId() != null) { _node.setSlaTimerId(((org.jbpm.workflow.instance.NodeInstance)nodeInstance).getSlaTimerId()); } _node.setContent( writeNodeInstanceContent( _node, nodeInstance, context ) ); return _node.build(); }