public void setName(String name) { // if the process definition is already set if (processDefinition != null) { // update the process definition action map Map actionMap = processDefinition.getActions(); // the != string comparison is to avoid null pointer checks. // no problem if the body is executed a few times too much :-) if (this.name != name && actionMap != null) { actionMap.remove(this.name); actionMap.put(name, this); } } // then update the name this.name = name; }
public void setName(String name) { // if the process definition is already set if (processDefinition != null) { // update the process definition action map Map actionMap = processDefinition.getActions(); // the != string comparison is to avoid null pointer checks. // no problem if the body is executed a few times too much :-) if ( (this.name != null && this.name.equals(name) || name != null) && actionMap != null) { actionMap.remove(this.name); actionMap.put(name, this); } } // then update the name this.name = name; }
private Document createDomTree(ProcessDefinition processDefinition) { Document document = DocumentHelper.createDocument(); Element root = addElement(document, "process-definition"); String value = processDefinition.getName(); if (value != null) root.addAttribute("name", value); // write the start-state if (processDefinition.getStartState() != null) { root.addComment("START-STATE"); writeStartNode(root, (StartState) processDefinition.getStartState()); } // write the nodeMap if (processDefinition.getNodes() != null && processDefinition.getNodes().size() > 0) { root.addComment("NODES"); writeNodes(root, processDefinition.getNodes()); } // write the process level actions if (processDefinition.hasEvents()) { root.addComment("PROCESS-EVENTS"); writeEvents(root, processDefinition); } if (processDefinition.hasActions()) { root.addComment("ACTIONS"); List namedProcessActions = getNamedProcessActions(processDefinition.getActions()); writeActions(root, namedProcessActions); } return document; }
private Document createDomTree(ProcessDefinition processDefinition) { Document document = DocumentHelper.createDocument(); Element root = addElement(document, "process-definition"); String value = processDefinition.getName(); if (value != null) root.addAttribute("name", value); // write the start-state if (processDefinition.getStartState() != null) { root.addComment("START-STATE"); writeStartNode(root, (StartState) processDefinition.getStartState()); } // write the nodeMap if (processDefinition.getNodes() != null && processDefinition.getNodes().size() > 0) { root.addComment("NODES"); writeNodes(root, processDefinition.getNodes()); } // write the process level actions if (processDefinition.hasEvents()) { root.addComment("PROCESS-EVENTS"); writeEvents(root, processDefinition); } if (processDefinition.hasActions()) { root.addComment("ACTIONS"); List namedProcessActions = getNamedProcessActions(processDefinition.getActions()); writeActions(root, namedProcessActions); } return document; }