Refine search
+ " xs:schemaLocation=\"" + namespace + " " + schemaLocation + "\"" + EOL + " type=\"" + type + "\" "); if (process.getName() != null) { xmlDump.append("name=\"" + process.getName() + "\" "); if (process.getId() != null) { xmlDump.append("id=\"" + process.getId() + "\" "); if (process.getPackageName() != null) { xmlDump.append("package-name=\"" + process.getPackageName() + "\" "); if (process.getVersion() != null) { xmlDump.append("version=\"" + process.getVersion() + "\" "); Integer routerLayout = (Integer) process.getMetaData().get("routerLayout"); if (routerLayout != null && routerLayout != 0) { xmlDump.append("routerLayout=\"" + routerLayout + "\" "); visitHeader(process, xmlDump, includeMeta); visitNodes(process, xmlDump, includeMeta); visitConnections(process.getNodes(), xmlDump, includeMeta); xmlDump.append("</process>");
private void registerExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { addEventListener(((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true); } } else if (node instanceof EventSubProcessNode) { List<String> events = ((EventSubProcessNode) node).getEvents(); for (String type : events) { addEventListener(type, EMPTY_EVENT_LISTENER, true); if (isVariableExpression(type)) { addEventListener(resolveVariable(type), EMPTY_EVENT_LISTENER, true); } } } else if (node instanceof DynamicNode) { if (((DynamicNode) node).getActivationEventName() != null) { addEventListener(((DynamicNode) node).getActivationEventName(), EMPTY_EVENT_LISTENER, true); } } } if( getWorkflowProcess().getMetaData().containsKey("Compensation") ) { addEventListener("Compensation", new CompensationEventListener(this), true); } }
@SuppressWarnings("unchecked") public void signalEvent(String type, Object event) { logger.debug("Signal {} received with data {} in process instance {}", type, event, getId()); synchronized (this) { if (getState() != ProcessInstance.STATE_ACTIVE) { return; TimerInstance timer = (TimerInstance) event; if (timer.getId() == slaTimerId) { handleSLAViolation(); for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event, getResolver(node, type, currentView))) { 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);
public static List<Node> getProcessActiveNodeList(final StatefulKnowledgeSession inSession, final WorkflowProcessInstanceImpl inInstance) { final List<Node> nodes = new ArrayList<>(); final WorkflowProcess process = (WorkflowProcess) inSession.getKnowledgeBase().getProcess(inInstance.getProcessId()); for (Node node : process.getNodes()) { if (node instanceof EventNode && ((EventNode) node).getFrom() == null) { // a free-standing event, without an entry point; this would be a start of an "optional" branch nodes.add(node); } else { // a node that has an inbound connection; all nodes on the main branch are of this kind List<NodeInstance> nodeInstances = inInstance.getNodeInstances(node.getId()); if (nodeInstances != null && !nodeInstances.isEmpty()) { for (NodeInstance nodeInstance : nodeInstances) { Node nodeInstanceNode = process.getNode(nodeInstance.getNodeId()); nodes.add(0, nodeInstanceNode); } } } } return nodes; }
public void assertPackageNameEquals(ProcessInstance process, String packageName) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getPackageName().equals(packageName)) { fail("Expected package name: " + packageName + " - found " + instance.getWorkflowProcess().getPackageName()); } }
public void assertVersionEquals(ProcessInstance process, String version) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getVersion().equals(version)) { fail("Expected version: " + version + " - found " + instance.getWorkflowProcess().getVersion()); } }
public void assertProcessNameEquals(ProcessInstance process, String name) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getName().equals(name)) { fail("Expected name: " + name + " - found " + instance.getWorkflowProcess().getName()); } }
public static Map<ConnectionRef, Constraint> getNextGatewayConstraints(final StatefulKnowledgeSession inSession, final WorkflowProcessInstanceImpl inInstance, final Node inTaskNode) { final Map<ConnectionRef, Constraint> constraints = new HashMap<>(); final WorkflowProcess process = (WorkflowProcess) inSession.getKnowledgeBase().getProcess(inInstance.getProcessId()); for (Node node : process.getNodes()) { if (!node.equals(inTaskNode)) { continue; } final List<Connection> nodeConnections = node.getOutgoingConnections(org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); if (nodeConnections != null && !nodeConnections.isEmpty()) { for (Connection c : nodeConnections) { final Node nextNode = c.getTo(); if (nextNode instanceof Split) { constraints.putAll(((Split) nextNode).getConstraints()); return constraints; } } } break; } return constraints; }
private void unregisterExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { externalEventListeners.remove(((EventNode) node).getType()); } } } }
private void visitNodes(WorkflowProcess process, StringBuilder xmlDump, boolean includeMeta) { xmlDump.append(" <nodes>" + EOL); for (Node node: process.getNodes()) { visitNode(node, xmlDump, includeMeta); } xmlDump.append(" </nodes>" + EOL + EOL); }
protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) { Map<String, Object> metaData = getMetaData(process.getMetaData()); Set<String> imports = ((org.jbpm.process.core.Process) process).getImports(); Map<String, String> globals = ((org.jbpm.process.core.Process) process).getGlobals(); if ((imports != null && !imports.isEmpty()) || (globals != null && globals.size() > 0) || !metaData.isEmpty()) { xmlDump.append(" <extensionElements>" + EOL); if (imports != null) { for (String s: imports) { xmlDump.append(" <tns:import name=\"" + s + "\" />" + EOL); } } if (globals != null) { for (Map.Entry<String, String> global: globals.entrySet()) { xmlDump.append(" <tns:global identifier=\"" + global.getKey() + "\" type=\"" + global.getValue() + "\" />" + EOL); } } writeMetaData(getMetaData(process.getMetaData()), xmlDump); xmlDump.append(" </extensionElements>" + EOL); } // TODO: function imports // TODO: exception handlers VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); if (variableScope != null) { visitVariables(variableScope.getVariables(), xmlDump); } visitLanes(process, xmlDump); }
public static Collection<ChecklistItem> getPendingChecklistItems(WorkflowProcess process) { List<ChecklistItem> result = new ArrayList<ChecklistItem>(); getPendingChecklistItems(process, result, process.getId()); return result; }
@SuppressWarnings("unchecked") public void signalEvent(String type, Object event) { logger.debug("Signal {} received with data {} in process instance {}", type, event, getId()); synchronized (this) { if (getState() != ProcessInstance.STATE_ACTIVE) { return; TimerInstance timer = (TimerInstance) event; if (timer.getId() == slaTimerId) { handleSLAViolation(); for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event, getResolver(node, type, currentView))) { 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);
private void registerExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { addEventListener(((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true); } } else if (node instanceof EventSubProcessNode) { List<String> events = ((EventSubProcessNode) node).getEvents(); for (String type : events) { addEventListener(type, EMPTY_EVENT_LISTENER, true); if (isVariableExpression(type)) { addEventListener(resolveVariable(type), EMPTY_EVENT_LISTENER, true); } } } else if (node instanceof DynamicNode) { if (((DynamicNode) node).getActivationEventName() != null) { addEventListener(((DynamicNode) node).getActivationEventName(), EMPTY_EVENT_LISTENER, true); } } } if( getWorkflowProcess().getMetaData().containsKey("Compensation") ) { addEventListener("Compensation", new CompensationEventListener(this), true); } }
public void assertPackageNameEquals(ProcessInstance process, String packageName) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getPackageName().equals(packageName)) { fail("Expected package name: " + packageName + " - found " + instance.getWorkflowProcess().getPackageName()); } }
public void assertVersionEquals(ProcessInstance process, String version) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getVersion().equals(version)) { fail("Expected version: " + version + " - found " + instance.getWorkflowProcess().getVersion()); } }
public void assertProcessNameEquals(ProcessInstance process, String name) { WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process; if (!instance.getWorkflowProcess().getName().equals(name)) { fail("Expected name: " + name + " - found " + instance.getWorkflowProcess().getName()); } }
private void unregisterExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { externalEventListeners.remove(((EventNode) node).getType()); } } } }
public void buildNodes(WorkflowProcess process, ProcessBuildContext context) { processNodes(process.getNodes(), process, context.getProcessDescr(), context); if ( !context.getErrors().isEmpty() ) { this.errors.addAll( context.getErrors() ); } ProcessDialectRegistry.getDialect(JavaDialect.ID).addProcess( context ); }
protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) { Map<String, Object> metaData = getMetaData(process.getMetaData()); Set<String> imports = ((org.jbpm.process.core.Process) process).getImports(); Map<String, String> globals = ((org.jbpm.process.core.Process) process).getGlobals(); if ((imports != null && !imports.isEmpty()) || (globals != null && globals.size() > 0) || !metaData.isEmpty()) { xmlDump.append(" <extensionElements>" + EOL); if (imports != null) { for (String s: imports) { xmlDump.append(" <tns:import name=\"" + s + "\" />" + EOL); } } if (globals != null) { for (Map.Entry<String, String> global: globals.entrySet()) { xmlDump.append(" <tns:global identifier=\"" + global.getKey() + "\" type=\"" + global.getValue() + "\" />" + EOL); } } writeMetaData(getMetaData(process.getMetaData()), xmlDump); xmlDump.append(" </extensionElements>" + EOL); } // TODO: function imports // TODO: exception handlers VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); if (variableScope != null) { visitVariables(variableScope.getVariables(), xmlDump); } visitLanes(process, xmlDump); }