((ProcessBuildData) parser.getData()).addNode(node); return node;
((ProcessBuildData) parser.getData()).addProcess(process); Object typedImports = ((ProcessBuildData) parser.getData()).getMetaData("Bpmn2Imports"); if (typedImports != null) { process.setMetaData("Bpmn2Imports", typedImports); Object itemDefinitions = ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); if (itemDefinitions != null) { process.setMetaData("ItemDefinitions", itemDefinitions);
/** * Read a <code>Process</code> from an <code>InputSource</code>. * * @param in * The rule-set input-source. * * @return The rule-set. */ public List<Process> read(final InputSource in) throws SAXException, IOException { this.processes = ((ProcessBuildData)this.parser.read( in )).getProcesses(); return this.processes; }
protected String checkSignalAndConvertToRealSignalNam(ExtensibleXmlParser parser, String signalName) { ProcessBuildData buildData = ((ProcessBuildData) parser.getData()); Set<String> signalNames = (Set<String>) buildData.getMetaData(SIGNAL_NAMES); if( signalNames == null ) { signalNames = new HashSet<>(); buildData.setMetaData(SIGNAL_NAMES, signalNames); } signalNames.add(signalName); Map<String, Signal> signals = (Map<String, Signal>) buildData.getMetaData("Signals"); if (signals != null ) { if( signals.containsKey(signalName)) { Signal signal = signals.get(signalName); signalName = signal.getName(); if (signalName == null) { throw new IllegalArgumentException("Signal definition must have a name attribute"); } } } return signalName; } }
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Definitions definitions = (Definitions) parser.getCurrent(); String namespace = element.getAttribute("targetNamespace"); List<Process> processes = ((ProcessBuildData) parser.getData()).getProcesses(); Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); List<Interface> interfaces = (List<Interface>) ((ProcessBuildData) parser.getData()).getMetaData("Interfaces"); for (Process process : processes) { RuleFlowProcess ruleFlowProcess = (RuleFlowProcess)process; ruleFlowProcess.setMetaData("TargetNamespace", namespace); postProcessItemDefinitions(ruleFlowProcess, itemDefinitions, parser.getClassLoader()); postProcessInterfaces(ruleFlowProcess, interfaces); } definitions.setTargetNamespace(namespace); return definitions; }
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); String id = attrs.getValue("id"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Sentry> sentries = (Map<String, Sentry>) buildData.getMetaData("Sentries"); Sentry sentryStub = sentries.get(id); if (sentryStub == null) { sentryStub = new Sentry(id, null, null); sentries.put(id, sentryStub); } return sentryStub; }
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Node node = (Node) parser.getCurrent(); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, PlanItem> planItems = (Map<String, PlanItem>) buildData.getMetaData("PlanItems"); PlanItem planItem = planItems.get(node.getMetaData().get("UniqueId")); if (planItem != null && planItem.getEntryCriterion() != null) { if ("autostart".equalsIgnoreCase(planItem.getEntryCriterion().getExpression())) { node.setMetaData("customAutoStart", "true"); } else { node.setMetaData("customActivationExpression", planItem.getEntryCriterion().getExpression()); node.setMetaData("customActivationFragmentName", node.getName()); } } handleNode(node, element, uri, localName, parser); NodeContainer nodeContainer = (NodeContainer) parser.getParent(); nodeContainer.addNode(node); ((ProcessBuildData) parser.getData()).addNode(node); return node; }
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder( localName, attrs ); final String id = attrs.getValue( "id" ); final String name = attrs.getValue( "name" ); final String version = attrs.getValue( "version" ); final String type = attrs.getValue( "type" ); final String packageName = attrs.getValue( "package-name" ); final String routerLayout = attrs.getValue( "routerLayout" ); RuleFlowProcess process = new RuleFlowProcess(); process.setId( id ); process.setName( name ); process.setVersion( version ); process.setType( type ); process.setPackageName( packageName ); if (routerLayout != null) { process.setMetaData("routerLayout", new Integer(routerLayout)); } ((ProcessBuildData)parser.getData()).addProcess( process ); return process; }
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); String id = attrs.getValue("id"); String errorCode = attrs.getValue("errorCode"); String structureRef = attrs.getValue("structureRef"); Definitions definitions = (Definitions) parser.getParent(); List<Error> errors = definitions.getErrors(); if (errors == null) { errors = new ArrayList<Error>(); definitions.setErrors(errors); ((ProcessBuildData) parser.getData()).setMetaData("Errors", errors); } Error e = new Error(id, errorCode, structureRef); errors.add(e); return e; }
buildProcess(process, resource); xmlReader.getProcessBuildData().onBuildComplete(process);
public List<Process> getProcesses() { for (Process process : processes) { onComplete(process); } return processes; }
public void setMetaData(String name, Object data) { onMetaData(name, data); this.metaData.put(name, data); }
public XmlProcessReader(final SemanticModules modules, ClassLoader classLoader, final SAXParser parser) { this.parser = new ExtensibleXmlParser() { @Override protected String buildPrintMessage(final SAXParseException x) { return processParserMessage(super.getParents(), super.getAttrs(), super.buildPrintMessage(x)); } }; if(parser != null) { this.parser.setParser(parser); } this.parser.setSemanticModules( modules ); this.parser.setData( new ProcessBuildData() ); this.parser.setClassLoader( classLoader ); }
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); String id = attrs.getValue("id"); String externalRef = attrs.getValue("externalRef"); if (externalRef.contains(":")) { externalRef = externalRef.split(":")[1]; } logger.debug("Found process reference with id {} and external ref {}", id, externalRef); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, String> processes = (Map<String, String>) buildData.getMetaData("ProcessElements"); if (processes == null) { processes = new HashMap<String, String>(); buildData.setMetaData("ProcessElements", processes); } processes.put(id, externalRef); return null; }
if (escalationRef != null && escalationRef.trim().length() > 0) { Map<String, Escalation> escalations = (Map<String, Escalation>) ((ProcessBuildData) parser.getData()).getMetaData(ProcessHandler.ESCALATIONS); if (escalations == null) { throw new IllegalArgumentException("No escalations found");
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Definitions definitions = (Definitions) parser.getCurrent(); String namespace = element.getAttribute("targetNamespace"); List<Process> processes = ((ProcessBuildData) parser.getData()).getProcesses(); Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); List<Interface> interfaces = (List<Interface>) ((ProcessBuildData) parser.getData()).getMetaData("Interfaces"); for (Process process : processes) { RuleFlowProcess ruleFlowProcess = (RuleFlowProcess)process; ruleFlowProcess.setMetaData("TargetNamespace", namespace); postProcessItemDefinitions(ruleFlowProcess, itemDefinitions, parser.getClassLoader()); postProcessInterfaces(ruleFlowProcess, interfaces); } definitions.setTargetNamespace(namespace); return definitions; }
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { final Element element = parser.endElementBuilder(); Node node = (Node) parser.getCurrent(); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, PlanItem> planItems = (Map<String, PlanItem>) buildData.getMetaData("PlanItems"); PlanItem planItem = planItems.get(node.getMetaData().get("UniqueId")); if (planItem != null && planItem.getEntryCriterion() != null) { if ("autostart".equalsIgnoreCase(planItem.getEntryCriterion().getExpression())) { node.setMetaData("customAutoStart", "true"); } else { node.setMetaData("customActivationExpression", planItem.getEntryCriterion().getExpression()); node.setMetaData("customActivationFragmentName", node.getName()); } } handleNode(node, element, uri, localName, parser); NodeContainer nodeContainer = (NodeContainer) parser.getParent(); nodeContainer.addNode(node); ((ProcessBuildData) parser.getData()).addNode(node); return node; }
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder( localName, attrs ); final String id = attrs.getValue( "id" ); final String name = attrs.getValue( "name" ); final String version = attrs.getValue( "version" ); final String type = attrs.getValue( "type" ); final String packageName = attrs.getValue( "package-name" ); final String routerLayout = attrs.getValue( "routerLayout" ); RuleFlowProcess process = new RuleFlowProcess(); process.setId( id ); process.setName( name ); process.setVersion( version ); process.setType( type ); process.setPackageName( packageName ); if (routerLayout != null) { process.setMetaData("routerLayout", new Integer(routerLayout)); } ((ProcessBuildData)parser.getData()).addProcess( process ); return process; }
variables.add(variable); ((ProcessBuildData) parser.getData()).setMetaData("Variable", variable); return variable;
buildProcess(process, resource); xmlReader.getProcessBuildData().onBuildComplete(process);