@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; }
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); final String type = attrs.getValue("importType"); final String location = attrs.getValue("location"); final String namespace = attrs.getValue("namespace"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); if (type != null && location != null && namespace != null) { List<Bpmn2Import> typedImports = (List<Bpmn2Import>) buildData.getMetaData("Bpmn2Imports"); if (typedImports == null) { typedImports = new ArrayList< Bpmn2Import>(); buildData.setMetaData("Bpmn2Imports", typedImports); } typedImports.add(new Bpmn2Import(type, location, namespace)); } return null; }
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); // according to the (Semantic.)xsd, both the name and structureRef are optional String id = attrs.getValue("id"); String name = attrs.getValue("name"); // referred to by the signalEventDefinition.signalRef attr String structureRef = attrs.getValue("structureRef"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Signal> signals = (Map<String, Signal>) buildData.getMetaData("Signals"); if (signals == null) { signals = new HashMap<String, Signal>(); buildData.setMetaData("Signals", signals); } Signal s = new Signal(id, name, structureRef); signals.put(id, s); return s; }
@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 escalationCode = attrs.getValue("escalationCode"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Escalation> escalations = (Map<String, Escalation>) buildData.getMetaData(ProcessHandler.ESCALATIONS); if (escalations == null) { escalations = new HashMap<String, Escalation>(); buildData.setMetaData(ProcessHandler.ESCALATIONS, escalations); } Escalation e = new Escalation(id, escalationCode); escalations.put(id, e); return e; }
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; } }
@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 definitionRef = attrs.getValue("definitionRef"); logger.debug("Found plan item with id {} and definitionRef {}", id, definitionRef); // save plan item so they can be easily referenced later ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, PlanItem> planItems = (Map<String, PlanItem>) buildData.getMetaData("PlanItems"); if (planItems == null) { planItems = new HashMap<String, PlanItem>(); buildData.setMetaData("PlanItems", planItems); } PlanItem planItem = new PlanItem(id, definitionRef); planItems.put(definitionRef, planItem); return planItem; }
@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"); String name = attrs.getValue("name"); String implementation = attrs.getValue("implementationType"); String namespace = ""; if (externalRef.contains(":")) { String[] elements = externalRef.split(":"); namespace = elements[0]; externalRef = elements[1]; } logger.debug("Found process reference with id {} and external ref {}", id, externalRef); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Decision> decisions = (Map<String, Decision>) buildData.getMetaData("DecisionElements"); if (decisions == null) { decisions = new HashMap<String, Decision>(); buildData.setMetaData("DecisionElements", decisions); } if (DMN_IMPLEMENTATION_TYPE.equals(implementation)) { decisions.put(id, new Decision(namespace, externalRef, name)); } return null; }
@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 name = attrs.getValue("name"); String implRef = attrs.getValue("implementationRef"); if (name == null || name.isEmpty()) { throw new IllegalArgumentException("Interface name is required attribute"); } ProcessBuildData buildData = (ProcessBuildData) parser.getData(); List<Interface> interfaces = (List<Interface>) buildData.getMetaData("Interfaces"); if (interfaces == null) { interfaces = new ArrayList<Interface>(); buildData.setMetaData("Interfaces", interfaces); } Interface i = new Interface(id, name); if (implRef != null) { i.setImplementationRef(implRef); } interfaces.add(i); return i; }
@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 type = attrs.getValue("structureRef"); if (type == null || type.trim().length() == 0) { type = "java.lang.Object"; } ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) buildData.getMetaData("ItemDefinitions"); if (itemDefinitions == null) { itemDefinitions = new HashMap<String, ItemDefinition>(); buildData.setMetaData("ItemDefinitions", itemDefinitions); } ItemDefinition itemDefinition = new ItemDefinition(id); itemDefinition.setStructureRef(type); itemDefinitions.put(id, itemDefinition); return itemDefinition; }
@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; }
@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 name = attrs.getValue("name"); String type = attrs.getValue("structureRef"); if (type == null || type.trim().length() == 0) { type = "java.lang.Object"; } ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, FileItemDefinition> itemDefinitions = (Map<String, FileItemDefinition>) buildData.getMetaData("FileItemDefinitions"); if (itemDefinitions == null) { itemDefinitions = new HashMap<String, FileItemDefinition>(); buildData.setMetaData("FileItemDefinitions", itemDefinitions); } FileItemDefinition itemDefinition = new FileItemDefinition(id); itemDefinition.setName(name); itemDefinition.setStructureRef(type); itemDefinitions.put(id, itemDefinition); return itemDefinition; }
@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 name = attrs.getValue("name"); logger.debug("Found case role with id {} and name {}", id, name); RuleFlowProcess process = ((RuleFlowProcess) parser.getParent(RuleFlowProcess.class)); String caseRoles = (String) process.getMetaData("customCaseRoles"); if (caseRoles == null) { caseRoles = name; } else { caseRoles += "," + name; } process.setMetaData("customCaseRoles", caseRoles); // save case roles so they can be easily referenced later for human task performer ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Role> roles = (Map<String, Role>) buildData.getMetaData("Roles"); if (roles == null) { roles = new HashMap<String, Role>(); buildData.setMetaData("Roles", roles); } Role role = new Role(id, name); roles.put(id, role); return role; }
if (messages == null) { messages = new HashMap<String, Message>(); buildData.setMetaData("Messages", messages);
if (sentries == null) { sentries = new HashMap<String, Sentry>(); buildData.setMetaData("Sentries", sentries);
if (fileItems == null) { fileItems = new HashMap<String, String>(); buildData.setMetaData("FileItems", fileItems); ((ProcessBuildData) parser.getData()).setMetaData("Variable", variable); return variable;
variables.add(variable); ((ProcessBuildData) parser.getData()).setMetaData("Variable", variable); return variable;
@SuppressWarnings("unchecked") public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); // according to the (Semantic.)xsd, both the name and structureRef are optional String id = attrs.getValue("id"); String name = attrs.getValue("name"); // referred to by the signalEventDefinition.signalRef attr String structureRef = attrs.getValue("structureRef"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Signal> signals = (Map<String, Signal>) buildData.getMetaData("Signals"); if (signals == null) { signals = new HashMap<String, Signal>(); buildData.setMetaData("Signals", signals); } Signal s = new Signal(id, name, structureRef); signals.put(id, s); return s; }
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 start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); final String type = attrs.getValue("importType"); final String location = attrs.getValue("location"); final String namespace = attrs.getValue("namespace"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); if (type != null && location != null && namespace != null) { List<Bpmn2Import> typedImports = (List<Bpmn2Import>) buildData.getMetaData("Bpmn2Imports"); if (typedImports == null) { typedImports = new ArrayList< Bpmn2Import>(); buildData.setMetaData("Bpmn2Imports", typedImports); } typedImports.add(new Bpmn2Import(type, location, namespace)); } return null; }
@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 escalationCode = attrs.getValue("escalationCode"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, Escalation> escalations = (Map<String, Escalation>) buildData.getMetaData(ProcessHandler.ESCALATIONS); if (escalations == null) { escalations = new HashMap<String, Escalation>(); buildData.setMetaData(ProcessHandler.ESCALATIONS, escalations); } Escalation e = new Escalation(id, escalationCode); escalations.put(id, e); return e; }