public void setValue(Object value) { node.setMetaData(name, value); } public DataType getType() {
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); node.setMetaData("Transaction", true); }
private void postProcessNodeOffset(Node[] nodes, int xOffset, int yOffset) { for (Node node: nodes) { Integer x = (Integer) node.getMetaData().get("x"); if (x != null) { ((org.jbpm.workflow.core.Node) node).setMetaData("x", x - xOffset); } Integer y = (Integer) node.getMetaData().get("y"); if (y != null) { ((org.jbpm.workflow.core.Node) node).setMetaData("y", y - yOffset); } if (node instanceof NodeContainer) { postProcessNodeOffset(((NodeContainer) node).getNodes(), xOffset + (x == null ? 0 : x), yOffset + (y == null ? 0 : y)); } } }
if (x != null && x.length() != 0) { try { node.setMetaData("x", Integer.parseInt(x)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'x' attribute", parser.getLocator()); if (y != null && y.length() != 0) { try { node.setMetaData("y", new Integer(y)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'y' attribute", parser.getLocator()); if (width != null && width.length() != 0) { try { node.setMetaData("width", new Integer(width)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'width' attribute", parser.getLocator()); if (height != null && height.length() != 0) { try { node.setMetaData("height", new Integer(height)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'height' attribute", parser.getLocator());
activityRef = ""; node.setMetaData("compensation-activityRef", activityRef);
if (x != null && x.length() != 0) { try { node.setMetaData("x", new Integer(x)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'x' attribute", parser.getLocator()); if (y != null && y.length() != 0) { try { node.setMetaData("y", new Integer(y)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'y' attribute", parser.getLocator()); if (width != null && width.length() != 0) { try { node.setMetaData("width", new Integer(width)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'width' attribute", parser.getLocator()); if (height != null && height.length() != 0) { try { node.setMetaData("height", new Integer(height)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'height' attribute", parser.getLocator()); if (color != null && color.length() != 0) { try { node.setMetaData("color", new Integer(color)); } catch (NumberFormatException exc) { throw new SAXParseException("<" + localName + "> requires an Integer 'color' attribute", parser.getLocator());
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); final Node node = createNode(attrs); String id = attrs.getValue("id"); node.setMetaData("UniqueId", id); final String name = attrs.getValue("name"); node.setName(name); AtomicInteger idGen = (AtomicInteger) parser.getMetaData().get("idGen"); node.setId(idGen.getAndIncrement()); return node; }
protected void applyAsync(Node node, boolean isAsync) { for (org.kie.api.definition.process.Node subNode: ((CompositeContextNode) node).getNodes()) { if (isAsync) { List<Connection> incoming = subNode.getIncomingConnections(NodeImpl.CONNECTION_DEFAULT_TYPE); if (incoming != null) { for (Connection con : incoming) { if (con.getFrom() instanceof StartNode) { ((Node)subNode).setMetaData("customAsync", Boolean.toString(isAsync)); return; } } } } } }
private boolean processNodeInfo(NodeInfo nodeInfo, Node[] nodes) { if (nodeInfo == null || nodeInfo.getNodeRef() == null) { return false; } for (Node node: nodes) { String id = (String) node.getMetaData().get("UniqueId"); if (nodeInfo.getNodeRef().equals(id)) { ((org.jbpm.workflow.core.Node) node).setMetaData("x", nodeInfo.getX()); ((org.jbpm.workflow.core.Node) node).setMetaData("y", nodeInfo.getY()); ((org.jbpm.workflow.core.Node) node).setMetaData("width", nodeInfo.getWidth()); ((org.jbpm.workflow.core.Node) node).setMetaData("height", nodeInfo.getHeight()); return true; } if (node instanceof NodeContainer) { boolean found = processNodeInfo(nodeInfo, ((NodeContainer) node).getNodes()); if (found) { return true; } } } return false; }
String id = element.getAttribute("id"); node.setMetaData("UniqueId", id); node.setMetaData(LINK_NAME, name); if ("target".equals(nodeName)) { String target = xmlNode.getTextContent(); node.setMetaData("target", target); aLink.setTarget(target); node.setMetaData("source", source); aLink.addSource(source);
node.setMetaData("UniqueId", id); node.setMetaData(LINK_NAME, name); node.setMetaData(LINK_TARGET, target); node.setMetaData(LINK_SOURCE, sources);
super.handleNode(node, element, uri, localName, parser); ActionNode actionNode = (ActionNode) node; node.setMetaData("NodeType", "ScriptTask"); DroolsConsequenceAction action = (DroolsConsequenceAction) actionNode.getAction(); if (action == null) {
final Node node = createNode(attrs); String id = attrs.getValue("id"); node.setMetaData("UniqueId", id); final String name = attrs.getValue("name"); node.setName(name);
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; }
String uniqueId = (String) node.getMetaData().get("UniqueId"); forEachNode.setMetaData("UniqueId", uniqueId); node.setMetaData("UniqueId", uniqueId + ":" + uniqueIdGen++); node.setMetaData("hidden", true); forEachNode.addNode(node); forEachNode.linkIncomingConnections(NodeImpl.CONNECTION_DEFAULT_TYPE, node.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE); Map<String, String> dataOutputs = (Map<String, String>) orignalNode.getMetaData().remove("DataOutputs"); orignalNode.setMetaData("MICollectionOutput", dataOutputs.get(((ForEachNode)node).getMetaData("MICollectionOutput"))); orignalNode.setMetaData("MICollectionInput", dataInputs.get(((ForEachNode)node).getMetaData("MICollectionInput")));
String uniqueId = (String) node.getMetaData().get("UniqueId"); forEachNode.setMetaData("UniqueId", uniqueId); node.setMetaData("UniqueId", uniqueId + ":" + uniqueIdGen++); forEachNode.addNode(node); forEachNode.linkIncomingConnections(NodeImpl.CONNECTION_DEFAULT_TYPE, node.getId(), NodeImpl.CONNECTION_DEFAULT_TYPE);
private void addCompensationScope(final Node node, final org.kie.api.definition.process.NodeContainer parentContainer, final String compensationHandlerId) { ContextContainer contextContainer = (ContextContainer) parentContainer; CompensationScope scope = null; boolean addScope = false; if (contextContainer.getContexts(CompensationScope.COMPENSATION_SCOPE) == null) { addScope = true; } else { scope = (CompensationScope) contextContainer.getContexts(CompensationScope.COMPENSATION_SCOPE).get(0); if (scope == null) { addScope = true; } } if (addScope) { scope = new CompensationScope(); contextContainer.addContext(scope); contextContainer.setDefaultContext(scope); scope.setContextContainer(contextContainer); } CompensationHandler handler = new CompensationHandler(); handler.setNode(node); scope.setExceptionHandler(compensationHandlerId, handler); node.setMetaData("isForCompensation", Boolean.TRUE); }
public void setValue(Object value) { node.setMetaData(name, value); } public DataType getType() {
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); node.setMetaData("Transaction", true); }
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { parser.startElementBuilder(localName, attrs); final Node node = createNode(attrs); String id = attrs.getValue("id"); node.setMetaData("UniqueId", id); final String name = attrs.getValue("name"); node.setName(name); AtomicInteger idGen = (AtomicInteger) parser.getMetaData().get("idGen"); node.setId(idGen.getAndIncrement()); return node; }