Package org.jbpm.workflow.core.node

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


        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


    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 xsi:type=\"tFormalExpression\" language=\"" + XmlBPMNProcessDumper.RULE_LANGUAGE + "\">" + constraintTrigger.getConstraint() + "</condition>" + EOL);
                  xmlDump.append("      </conditionalEventDefinition>" + EOL);
          } else {
            String header = constraintTrigger.getHeader();
            header = header.substring(7, header.length() - 1);
            int index = header.indexOf(":");
            String language = header.substring(0, index);
            header = header.substring(index + 1);
            String cycle = null;
            if ("int".equals(language)) {
              int lenght = (header.length() - 1)/2;
              cycle = header.substring(0, lenght);
            } else {
              cycle = header;
            }
              xmlDump.append("      <timerEventDefinition>" + EOL);
                  xmlDump.append("        <timeCycle xsi:type=\"tFormalExpression\" language=\"" + language + "\">" + cycle + "</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

TOP

Related Classes of org.jbpm.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.