Package org.drools.workflow.core.node

Examples of org.drools.workflow.core.node.Trigger


    if (triggers != null) {
        xmlDump.append(">" + EOL);
        if (triggers.size() > 1) {
            throw new IllegalArgumentException("Multiple start triggers not supported");
        }
        Trigger trigger = triggers.get(0);
        if (trigger instanceof ConstraintTrigger) {
          ConstraintTrigger constraintTrigger = (ConstraintTrigger) trigger;
          if (constraintTrigger.getHeader() == null) {
              xmlDump.append("      <conditionalEventDefinition>" + EOL);
                  xmlDump.append("        <condition xs:type=\"tFormalExpression\" language=\"" + XmlBPMNProcessDumper.RULE_LANGUAGE + "\">" + constraintTrigger.getConstraint() + "</condition>" + EOL);
                  xmlDump.append("      </conditionalEventDefinition>" + EOL);
          } else {
            String header = constraintTrigger.getHeader();
            int lenght = (header.length() - 13)/2;
            String period = header.substring(11, 11 + lenght);
              xmlDump.append("      <timerEventDefinition>" + EOL);
                  xmlDump.append("        <timeCycle xs:type=\"tFormalExpression\">" + period + "</timeCycle>" + EOL);
                  xmlDump.append("      </timerEventDefinition>" + EOL);
          }
        } else if (trigger instanceof EventTrigger) {
            EventTrigger eventTrigger = (EventTrigger) trigger;
            if (!trigger.getInMappings().isEmpty()) {
                String mapping = eventTrigger.getInMappings().keySet().iterator().next();
                xmlDump.append(
                      "      <dataOutput id=\"_" + startNode.getId() + "_Output\" />" + EOL +
                        "      <dataOutputAssociation>" + EOL +
                        "        <sourceRef>_" + startNode.getId() + "_Output</sourceRef>" + EOL +
View Full Code Here


                    "  <itemDefinition id=\"" + XmlDumper.replaceIllegalChars(messageRef) + "Type\" structureRef=\"" + XmlDumper.replaceIllegalChars(messageType) + "\"/>" + EOL +
                    "  <message id=\"" + XmlDumper.replaceIllegalChars(messageRef) + "\" structureRef=\"" + XmlDumper.replaceIllegalChars(messageRef) + "Type\" />" + EOL + EOL);
            } else if (node instanceof StartNode) {
                StartNode startNode = (StartNode) node;
                if (startNode.getTriggers() != null && !startNode.getTriggers().isEmpty()) {
                    Trigger trigger = startNode.getTriggers().get(0);
                    if (trigger instanceof EventTrigger) {
                        String eventType = ((EventTypeFilter) ((EventTrigger) trigger).getEventFilters().get(0)).getType();
                        if (eventType.startsWith("Message-")) {
                            eventType = eventType.substring(8);
                            String messageType = (String) node.getMetaData().get("MessageType");
View Full Code Here

    if (triggers != null) {
        xmlDump.append(">" + EOL);
        if (triggers.size() > 1) {
            throw new IllegalArgumentException("Multiple start triggers not supported");
        }
        Trigger trigger = triggers.get(0);
        if (trigger instanceof ConstraintTrigger) {
          ConstraintTrigger constraintTrigger = (ConstraintTrigger) trigger;
          if (constraintTrigger.getHeader() == null) {
              xmlDump.append("      <conditionalEventDefinition>" + EOL);
                  xmlDump.append("        <condition xs:type=\"tFormalExpression\" language=\"" + XmlBPMNProcessDumper.RULE_LANGUAGE + "\">" + constraintTrigger.getConstraint() + "</condition>" + EOL);
                  xmlDump.append("      </conditionalEventDefinition>" + EOL);
          } else {
            String header = constraintTrigger.getHeader();
            int lenght = (header.length() - 13)/2;
            String period = header.substring(11, 11 + lenght);
              xmlDump.append("      <timerEventDefinition>" + EOL);
                  xmlDump.append("        <timeCycle xs:type=\"tFormalExpression\">" + period + "</timeCycle>" + EOL);
                  xmlDump.append("      </timerEventDefinition>" + EOL);
          }
        } else if (trigger instanceof EventTrigger) {
            EventTrigger eventTrigger = (EventTrigger) trigger;
            if (!trigger.getInMappings().isEmpty()) {
                String mapping = eventTrigger.getInMappings().keySet().iterator().next();
                xmlDump.append(
                      "      <dataOutput id=\"_" + startNode.getId() + "_Output\" />" + EOL +
                        "      <dataOutputAssociation>" + EOL +
                        "        <sourceRef>_" + startNode.getId() + "_Output</sourceRef>" + EOL +
View Full Code Here

                  }
              }
            } else if (node instanceof StartNode) {
                StartNode startNode = (StartNode) node;
                if (startNode.getTriggers() != null && !startNode.getTriggers().isEmpty()) {
                    Trigger trigger = startNode.getTriggers().get(0);
                    if (trigger instanceof EventTrigger) {
                        String eventType = ((EventTypeFilter) ((EventTrigger) trigger).getEventFilters().get(0)).getType();
                        if (eventType.startsWith("Message-")) {
                            eventType = eventType.substring(8);
                            String messageType = (String) node.getMetaData().get("MessageType");
View Full Code Here

        parser.startElementBuilder( localName, attrs );
        StartNode startNode = (StartNode) parser.getParent();
        String type = attrs.getValue("type");
        emptyAttributeCheck( localName, "type", type, parser );
       
        Trigger trigger = null;
        if ("constraint".equals(type)) {
          trigger = new ConstraintTrigger();
        } else if ("event".equals(type)) {
          trigger = new EventTrigger();
        } else {
View Full Code Here

        parser.startElementBuilder( localName, attrs );
        StartNode startNode = (StartNode) parser.getParent();
        String type = attrs.getValue("type");
        emptyAttributeCheck( localName, "type", type, parser );
       
        Trigger trigger = null;
        if ("constraint".equals(type)) {
          trigger = new ConstraintTrigger();
        } else if ("event".equals(type)) {
          trigger = new EventTrigger();
        } else {
View Full Code Here

TOP

Related Classes of org.drools.workflow.core.node.Trigger

Copyright © 2018 www.massapicom. 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.