Examples of DroolsAction


Examples of org.jbpm.workflow.core.DroolsAction

        }
        if (period != null && period.length() != 0 ) {
            timer.setPeriod(period);
        }
        org.w3c.dom.Node xmlNode = element.getFirstChild();
        DroolsAction action = null;
        if (xmlNode instanceof Element) {
        Element actionXml = (Element) xmlNode;
        action = AbstractNodeHandler.extractAction(actionXml);
        }
        parent.addTimer(timer, action);
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

          if (nodeName.equals(type)) {
            List<DroolsAction> actions = new ArrayList<DroolsAction>();
            NodeList subNodeList = xmlNode.getChildNodes();
                for (int j = 0; j < subNodeList.getLength(); j++) {
                  Element subXmlNode = (Element) subNodeList.item(j);
                  DroolsAction action = extractAction(subXmlNode);
                  actions.add(action);
                }
              node.setActions(type, actions);
            return;
          }
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

        super.handleNode(node, element, uri, localName, parser);
        ActionNode actionNode = (ActionNode) node;
        org.w3c.dom.Node xmlNode = element.getFirstChild();
        if (xmlNode instanceof Element) {
        Element actionXml = (Element) xmlNode;
        DroolsAction action = extractAction(actionXml);
        actionNode.setAction(action);
        }
    }
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
              if (action != null) {
                AbstractNodeHandler.writeAction(action, xmlDump);
              }
              xmlDump.append("      </exceptionHandler>" + EOL);
              } else {
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

                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);
                    }
            }
              }
          }
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

    //
    // Allow the creation of programmatic actions that implement org.jbpm.process.instance.impl.Action interface.
    // I just want to write simple classes to execute arbitrary logic without having to use a file.
    //
    public ActionNodeFactory action(Action action) {
      DroolsAction droolsAction = new DroolsAction();
      droolsAction.setMetaData("Action",action);
      getActionNode().setAction(droolsAction);
      return this;
  }   
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

        process.addNode(eventNode);
       
        final List<String> myList = new ArrayList<String>();
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Print");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
              System.out.println("Detected event for person " + ((Person) context.getVariable("event")).getName());
                myList.add("Executed action");
            }
        });
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

        process.addNode(eventNode);
       
        final List<String> myList = new ArrayList<String>();
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Print");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
              System.out.println("Detected event for person " + ((Person) context.getVariable("event")).getName());
                myList.add("Executed action");
            }
        });
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

        process.addNode(eventNode);
       
        final List<String> myList = new ArrayList<String>();
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Print");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
              System.out.println("Detected event for person " + ((Person) context.getVariable("event")).getName());
                myList.add("Executed action");
            }
        });
        actionNode.setAction(action);
        actionNode.setId(4);
        process.addNode(actionNode);
        new ConnectionImpl(
            eventNode, Node.CONNECTION_DEFAULT_TYPE,
            actionNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        EventNode eventNode2 = new EventNode();
        eventFilter = new EventTypeFilter();
        eventFilter.setType("myOtherEvent");
        eventNode2.addEventFilter(eventFilter);
        eventNode2.setVariableName("event");
        eventNode2.setId(5);
        process.addNode(eventNode2);
       
        ActionNode actionNode2 = new ActionNode();
        actionNode2.setName("Print");
        action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
              System.out.println("Detected other event for person " + ((Person) context.getVariable("event")).getName());
                myList.add("Executed action");
            }
        });
View Full Code Here

Examples of org.jbpm.workflow.core.DroolsAction

        process.addNode(eventNode);
       
        final List<String> myList = new ArrayList<String>();
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Print");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
                myList.add("Executed action");
            }
        });
        actionNode.setAction(action);
        actionNode.setId(4);
        process.addNode(actionNode);
        new ConnectionImpl(
            eventNode, Node.CONNECTION_DEFAULT_TYPE,
            actionNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        EventNode eventNode2 = new EventNode();
        eventFilter = new EventTypeFilter();
        eventFilter.setType("myEvent");
        eventNode2.addEventFilter(eventFilter);
        eventNode2.setId(5);
        process.addNode(eventNode2);
       
        ActionNode actionNode2 = new ActionNode();
        actionNode2.setName("Print");
        action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(ProcessContext context) throws Exception {
                myList.add("Executed action");
            }
        });
        actionNode2.setAction(action);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.