Examples of EventNode


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

  public Class generateNodeFor() {
        return EventNode.class;
    }

  public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    EventNode eventNode = (EventNode) node;
    String attachedTo = (String) eventNode.getMetaData("AttachedTo");
    if (attachedTo == null) {
        writeNode("intermediateCatchEvent", eventNode, xmlDump, includeMeta);
        xmlDump.append(">" + EOL);
        if (eventNode.getVariableName() != null) {
          xmlDump.append("      <dataOutput id=\"" + XmlBPMNProcessDumper.getUniqueNodeId(eventNode) + "_Output\" name=\"event\" />" + EOL);
          xmlDump.append("      <dataOutputAssociation>" + EOL);
          xmlDump.append(
            "      <sourceRef>" + XmlBPMNProcessDumper.getUniqueNodeId(eventNode) + "_Output</sourceRef>" + EOL +
            "      <targetRef>" + XmlDumper.replaceIllegalChars(eventNode.getVariableName()) + "</targetRef>" + EOL);
          xmlDump.append("      </dataOutputAssociation>" + EOL);
          xmlDump.append("      <outputSet>" + EOL);
          xmlDump.append("        <dataOutputRefs>" + XmlBPMNProcessDumper.getUniqueNodeId(eventNode) + "_Output</dataOutputRefs>" + EOL);
          xmlDump.append("      </outputSet>" + EOL);
        }
        if (eventNode.getEventFilters().size() > 0) {
          String type = ((EventTypeFilter) eventNode.getEventFilters().get(0)).getType();
          if (type.startsWith("Message-")) {
              type = type.substring(8);
              xmlDump.append("      <messageEventDefinition messageRef=\"" + XmlDumper.replaceIllegalChars(type) + "\"/>" + EOL);
                } else {
                    xmlDump.append("      <signalEventDefinition signalRef=\"" + XmlDumper.replaceIllegalChars(type) + "\"/>" + EOL);
                }
        }
        endNode("intermediateCatchEvent", xmlDump);
    } else {
        String type = ((EventTypeFilter) eventNode.getEventFilters().get(0)).getType();
        if (type.startsWith("Escalation-")) {
            type = type.substring(attachedTo.length() + 12);
            boolean cancelActivity = (Boolean) eventNode.getMetaData("CancelActivity");
                writeNode("boundaryEvent", eventNode, xmlDump, includeMeta);
            xmlDump.append("attachedToRef=\"" + attachedTo + "\" ");
            if (!cancelActivity) {
                xmlDump.append("cancelActivity=\"false\" ");
            }
            xmlDump.append(">" + EOL);
            xmlDump.append("      <escalationEventDefinition escalationCode=\"" + XmlDumper.replaceIllegalChars(type) + "\" />" + EOL);
            endNode("boundaryEvent", xmlDump);
        } else if (type.startsWith("Error-")) {
                type = type.substring(attachedTo.length() + 7);
                writeNode("boundaryEvent", eventNode, xmlDump, includeMeta);
                xmlDump.append("attachedToRef=\"" + attachedTo + "\" ");
                xmlDump.append(">" + EOL);
                xmlDump.append("      <errorEventDefinition errorCode=\"" + XmlDumper.replaceIllegalChars(type) + "\" />" + EOL);
                endNode("boundaryEvent", xmlDump);
            } else if (type.startsWith("Timer-")) {
                type = type.substring(attachedTo.length() + 7);
                boolean cancelActivity = (Boolean) eventNode.getMetaData("CancelActivity");
                writeNode("boundaryEvent", eventNode, xmlDump, includeMeta);
                xmlDump.append("attachedToRef=\"" + attachedTo + "\" ");
                if (!cancelActivity) {
                    xmlDump.append("cancelActivity=\"false\" ");
                }
                xmlDump.append(">" + EOL);
                xmlDump.append(
                    "      <timerEventDefinition>" + EOL +
                    "        <timeCycle xs:type=\"tFormalExpression\">" + XmlDumper.replaceIllegalChars((String) eventNode.getMetaData("TimeCycle")) + "</timeCycle>" + EOL +
                    "      </timerEventDefinition>" + EOL);
                endNode("boundaryEvent", xmlDump);
            } else if (type.startsWith("Compensate-")) {
                type = type.substring(attachedTo.length() + 7);
                writeNode("boundaryEvent", eventNode, xmlDump, includeMeta);
View Full Code Here

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

    public EventNodeFactory(RuleFlowNodeContainerFactory nodeContainerFactory, NodeContainer nodeContainer, long id) {
        super(nodeContainerFactory, nodeContainer, id);
    }

    protected Node createNode() {
        return new EventNode();
    }
View Full Code Here

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

                            "Composite node '" + node.getName() + "' [" + node.getId() + "] has invalid linked outgoing node for type " + outType.getKey()));
                  }
                }
                validateNodes(compositeNode.getNodes(), errors, process);
            } else if (node instanceof EventNode) {
                final EventNode eventNode = (EventNode) node;
                if (eventNode.getEventFilters().size() == 0) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Event node '" + node.getName() + "' [" + node.getId() + "] should specify an event type"));
                }
                if (eventNode.getDefaultOutgoingConnections().size() == 0) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Event node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection"));
                }
            } else if (node instanceof FaultNode) {
              endNodeFound = true;
View Full Code Here

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

import org.xml.sax.SAXException;

public class BoundaryEventHandler extends AbstractNodeHandler {
   
    protected Node createNode(Attributes attrs) {
        return new EventNode();
    }
View Full Code Here

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

        process.addNode(new WorkItemNode());
        process.addNode(new TimerNode());
        process.addNode(new HumanTaskNode());
        process.addNode(new ForEachNode());
        process.addNode(new CompositeContextNode());
        process.addNode(new EventNode());
        process.addNode(new FaultNode());
        process.addNode(new StateNode());
        process.addNode(new DynamicNode());
       
        String xml = XmlRuleFlowProcessDumper.INSTANCE.dump(process, false);
View Full Code Here

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

        constraint.setConstraint("constraint-text2");
        split.setConstraint(connection, constraint);
        process.addNode(split);
        new ConnectionImpl(startNode, Node.CONNECTION_DEFAULT_TYPE, split, Node.CONNECTION_DEFAULT_TYPE);
       
        EventNode eventNode = new EventNode();
        eventNode.setName("action");
        eventNode.setMetaData("x", 1);
        eventNode.setMetaData("y", 2);
        eventNode.setMetaData("width", 3);
        eventNode.setMetaData("height", 4);
        eventNode.setVariableName("eventVariable");
        EventTypeFilter eventFilter = new EventTypeFilter();
        eventFilter.setType("eventType");
        eventNode.addEventFilter(eventFilter);
        process.addNode(eventNode);
       
        Join join = new Join();
        join.setName("join");
        join.setMetaData("x", 1);
View Full Code Here

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

            eventNode.setScope(scope);
        }
    }
   
    public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    EventNode eventNode = (EventNode) node;
    writeNode("eventNode", eventNode, xmlDump, includeMeta);
    String variableName = eventNode.getVariableName();
        if (variableName != null && variableName.length() != 0) {
            xmlDump.append("variableName=\"" + variableName + "\" ");
        }
        String scope = eventNode.getScope();
        if (scope != null && scope.length() != 0) {
            xmlDump.append("scope=\"" + scope + "\" ");
        }
        xmlDump.append(">" + EOL);
        if (includeMeta) {
          writeMetaData(eventNode, xmlDump);
        }
        xmlDump.append("      <eventFilters>" + EOL);
        for (EventFilter filter: eventNode.getEventFilters()) {
          if (filter instanceof EventTypeFilter) {
            xmlDump.append("        <eventFilter "
                    + "type=\"eventType\" "
                    + "eventType=\"" + ((EventTypeFilter) filter).getType() + "\" />" + EOL);
          } else {
View Full Code Here

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

import org.xml.sax.SAXException;

public class BoundaryEventHandler extends AbstractNodeHandler {
   
    protected Node createNode(Attributes attrs) {
        return new EventNode();
    }
View Full Code Here

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

    @SuppressWarnings("unchecked")
  protected void handleEscalationNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser, final String attachedTo,
            final boolean cancelActivity) throws SAXException {
        super.handleNode(node, element, uri, localName, parser);
        EventNode eventNode = (EventNode) node;
        eventNode.setMetaData("AttachedTo", attachedTo);
        eventNode.setMetaData("CancelActivity", cancelActivity);
        org.w3c.dom.Node xmlNode = element.getFirstChild();
        while (xmlNode != null) {
            String nodeName = xmlNode.getNodeName();
            if ("escalationEventDefinition".equals(nodeName)) {
                String escalationRef = ((Element) xmlNode).getAttribute("escalationRef");
                if (escalationRef != null && escalationRef.trim().length() > 0) {
                    Map<String, Escalation> escalations = (Map<String, Escalation>)
                    ((ProcessBuildData) parser.getData()).getMetaData("Escalations");
                if (escalations == null) {
                    throw new IllegalArgumentException("No escalations found");
                }
                Escalation escalation = escalations.get(escalationRef);
                if (escalation == null) {
                    throw new IllegalArgumentException("Could not find escalation " + escalationRef);
                }
                    List<EventFilter> eventFilters = new ArrayList<EventFilter>();
                    EventTypeFilter eventFilter = new EventTypeFilter();
                    String type = escalation.getEscalationCode();
                    eventFilter.setType("Escalation-" + attachedTo + "-" + type);
                    eventFilters.add(eventFilter);
                    eventNode.setEventFilters(eventFilters);
                    eventNode.setMetaData("EscalationEvent", type);
                }
            }
            xmlNode = xmlNode.getNextSibling();
        }
    }
View Full Code Here

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

    @SuppressWarnings("unchecked")
  protected void handleErrorNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser, final String attachedTo,
            final boolean cancelActivity) throws SAXException {
        super.handleNode(node, element, uri, localName, parser);
        EventNode eventNode = (EventNode) node;
        eventNode.setMetaData("AttachedTo", attachedTo);
        org.w3c.dom.Node xmlNode = element.getFirstChild();
        while (xmlNode != null) {
            String nodeName = xmlNode.getNodeName();
            if ("errorEventDefinition".equals(nodeName)) {
                String errorRef = ((Element) xmlNode).getAttribute("errorRef");
                if (errorRef != null && errorRef.trim().length() > 0) {
                  Map<String, Error> errors = (Map<String, Error>)
                    ((ProcessBuildData) parser.getData()).getMetaData("Errors");
                if (errors == null) {
                    throw new IllegalArgumentException("No errors found");
                }
                Error error = errors.get(errorRef);
                if (error == null) {
                    throw new IllegalArgumentException("Could not find error " + errorRef);
                }
                String type = error.getErrorCode();
                    List<EventFilter> eventFilters = new ArrayList<EventFilter>();
                    EventTypeFilter eventFilter = new EventTypeFilter();
                    eventFilter.setType("Error-" + attachedTo + "-" + type);
                    eventFilters.add(eventFilter);
                    eventNode.setEventFilters(eventFilters);
                    eventNode.setMetaData("ErrorEvent", type);
                }
            }
            xmlNode = xmlNode.getNextSibling();
        }
    }
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.