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); }
Integer routerLayout = (Integer) process.getMetaData().get("routerLayout"); if (routerLayout != null && routerLayout != 0) { xmlDump.append("routerLayout=\"" + routerLayout + "\" ");
protected void visitProcess(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) { String targetNamespace = (String) process.getMetaData().get("TargetNamespace"); if (targetNamespace == null) { targetNamespace = "http://www.jboss.org/drools"; ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); Set<String> dumpedItemDefs = new HashSet<String>(); Map<String, ItemDefinition> itemDefs = (Map<String, ItemDefinition>) process.getMetaData().get("ItemDefinitions"); Definitions def = (Definitions) process.getMetaData().get("Definitions"); visitErrors(def, xmlDump); visitConnections(process.getNodes(), xmlDump, metaDataType); List<Association> associations = (List<Association>) process.getMetaData().get(ProcessHandler.ASSOCIATIONS); if( associations != null ) { for (Association association : associations ) {
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); } }
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); }
Integer routerLayout = (Integer) process.getMetaData().get("routerLayout"); if (routerLayout != null && routerLayout != 0) { xmlDump.append("routerLayout=\"" + routerLayout + "\" ");
protected void visitProcess(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) { String targetNamespace = (String) process.getMetaData().get("TargetNamespace"); if (targetNamespace == null) { targetNamespace = "http://www.jboss.org/drools"; ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); Set<String> dumpedItemDefs = new HashSet<String>(); Map<String, ItemDefinition> itemDefs = (Map<String, ItemDefinition>) process.getMetaData().get("ItemDefinitions"); Definitions def = (Definitions) process.getMetaData().get("Definitions"); visitErrors(def, xmlDump); visitConnections(process.getNodes(), xmlDump, metaDataType); List<Association> associations = (List<Association>) process.getMetaData().get(ProcessHandler.ASSOCIATIONS); if( associations != null ) { for (Association association : associations ) {
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); } }