protected void handleScript(final ExtendedNodeImpl node, final Element element, String type) { NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { if (nodeList.item(i) instanceof Element) { Element xmlNode = (Element) nodeList.item(i); String nodeName = xmlNode.getNodeName(); if (nodeName.equals("extensionElements")) { NodeList subNodeList = xmlNode.getChildNodes(); for (int j = 0; j < subNodeList.getLength(); j++) { org.w3c.dom.Node subXmlNode = subNodeList.item(j); if(subXmlNode.getNodeName().contains(type + "-script")) { List<DroolsAction> actions = node.getActions(type); if (actions == null) { actions = new ArrayList<DroolsAction>(); node.setActions(type, actions); } DroolsAction action = extractScript((Element) subXmlNode); actions.add(action); } } } } } }
protected void writeExtensionElements(Node node, final StringBuilder xmlDump) { if (containsExtensionElements(node)) { xmlDump.append(" <extensionElements>" + EOL); if (node instanceof ExtendedNodeImpl) { writeScripts("onEntry", ((ExtendedNodeImpl) node).getActions("onEntry"), xmlDump); writeScripts("onExit", ((ExtendedNodeImpl) node).getActions("onExit"), xmlDump); } writeMetaData(node, xmlDump); xmlDump.append(" </extensionElements>" + EOL); } }
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { ExtendedNodeImpl extendedNode = ( ExtendedNodeImpl ) node; for (String type: extendedNode.getActionTypes()) { List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { buildAction(droolsAction, context, (NodeImpl) node); } } } }
protected void triggerEvent(String type) { ExtendedNodeImpl extendedNode = getExtendedNode(); if (extendedNode == null) { return; } List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { Action action = (Action) droolsAction.getMetaData("Action"); executeAction(action); } } }
protected void writeExtensionElements(Node node, final StringBuilder xmlDump) { if (containsExtensionElements(node)) { xmlDump.append(" <extensionElements>" + EOL); if (node instanceof ExtendedNodeImpl) { writeScripts("onEntry", ((ExtendedNodeImpl) node).getActions("onEntry"), xmlDump); writeScripts("onExit", ((ExtendedNodeImpl) node).getActions("onExit"), xmlDump); } writeMetaData(node, xmlDump); xmlDump.append(" </extensionElements>" + EOL); } }
protected void handleScript(final ExtendedNodeImpl node, final Element element, String type) { NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { if (nodeList.item(i) instanceof Element) { Element xmlNode = (Element) nodeList.item(i); String nodeName = xmlNode.getNodeName(); if (nodeName.equals("extensionElements")) { NodeList subNodeList = xmlNode.getChildNodes(); for (int j = 0; j < subNodeList.getLength(); j++) { org.w3c.dom.Node subXmlNode = subNodeList.item(j); if(subXmlNode.getNodeName().contains(type + "-script")) { List<DroolsAction> actions = node.getActions(type); if (actions == null) { actions = new ArrayList<DroolsAction>(); node.setActions(type, actions); } DroolsAction action = extractScript((Element) subXmlNode); actions.add(action); } } } } } }
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { ExtendedNodeImpl extendedNode = ( ExtendedNodeImpl ) node; for (String type: extendedNode.getActionTypes()) { List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { buildAction(droolsAction, context, (NodeImpl) node); } } } }
protected void triggerEvent(String type) { ExtendedNodeImpl extendedNode = getExtendedNode(); if (extendedNode == null) { return; } List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { Action action = (Action) droolsAction.getMetaData("Action"); executeAction(action); } } }