Package org.drools.workflow.core.node

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


    }

    protected void handleNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser) throws SAXException {
      super.handleNode(node, element, uri, localName, parser);
      SubProcessNode subProcessNode = (SubProcessNode) node;
    String processId = element.getAttribute("calledElement");
    if (processId != null) {
      subProcessNode.setProcessId(processId);
    }
    String waitForCompletion = element.getAttribute("waitForCompletion");
    if (waitForCompletion != null && "false".equals(waitForCompletion)) {
      subProcessNode.setWaitForCompletion(false);
    }
    String independent = element.getAttribute("independent");
    if (independent != null && "false".equals(independent)) {
      subProcessNode.setIndependent(false);
    }
      Map<String, String> dataInputs = new HashMap<String, String>();
      Map<String, String> dataOutputs = new HashMap<String, String>();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
        while (xmlNode != null) {
View Full Code Here


    String to = subNode.getTextContent();
    subProcessNode.addOutMapping(dataOutputs.get(from), to);
    }

  public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    SubProcessNode subProcessNode = (SubProcessNode) node;
    writeNode("callActivity", subProcessNode, xmlDump, includeMeta);
    if (subProcessNode.getProcessId() != null) {
      xmlDump.append("calledElement=\"" + XmlDumper.replaceIllegalChars(subProcessNode.getProcessId()) + "\" ");
    }
    if (!subProcessNode.isWaitForCompletion()) {
      xmlDump.append("tns:waitForCompletion=\"false\" ");
    }
    if (!subProcessNode.isIndependent()) {
      xmlDump.append("tns:independent=\"false\" ");
    }
    xmlDump.append(">" + EOL);
    writeIO(subProcessNode, xmlDump);
    endNode("callActivity", xmlDump);
View Full Code Here

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

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

                    errors.add(new ProcessValidationErrorImpl(process,
                        "State node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection"));
                }
            }
            else if (node instanceof SubProcessNode) {
                final SubProcessNode subProcess = (SubProcessNode) node;
                if (subProcess.getFrom() == null && !acceptsNoIncomingConnections(node)) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection."));
                }
                if (subProcess.getTo() == null && !acceptsNoOutgoingConnections(node)) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection."));
                }
                if (subProcess.getProcessId() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no process id."));
                }
                if (subProcess.getTimers() != null) {
                  for (Timer timer: subProcess.getTimers().keySet()) {
                    validateTimer(timer, node, process, errors);
                  }
                }
            } else if (node instanceof ActionNode) {
                final ActionNode actionNode = (ActionNode) node;
View Full Code Here

import org.xml.sax.SAXException;

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

    }

    protected void handleNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser) throws SAXException {
      super.handleNode(node, element, uri, localName, parser);
      SubProcessNode subProcessNode = (SubProcessNode) node;
    String processId = element.getAttribute("calledElement");
    if (processId != null) {
      subProcessNode.setProcessId(processId);
    }
    String waitForCompletion = element.getAttribute("waitForCompletion");
    if (waitForCompletion != null && "false".equals(waitForCompletion)) {
      subProcessNode.setWaitForCompletion(false);
    }
    String independent = element.getAttribute("independent");
    if (independent != null && "false".equals(independent)) {
      subProcessNode.setIndependent(false);
    }
      Map<String, String> dataInputs = new HashMap<String, String>();
      Map<String, String> dataOutputs = new HashMap<String, String>();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
        while (xmlNode != null) {
View Full Code Here

    String to = subNode.getTextContent();
    subProcessNode.addOutMapping(dataOutputs.get(from), to);
    }

  public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) {
    SubProcessNode subProcessNode = (SubProcessNode) node;
    writeNode("callActivity", subProcessNode, xmlDump, metaDataType);
    if (subProcessNode.getProcessId() != null) {
      xmlDump.append("calledElement=\"" + XmlDumper.replaceIllegalChars(subProcessNode.getProcessId()) + "\" ");
    }
    if (!subProcessNode.isWaitForCompletion()) {
      xmlDump.append("tns:waitForCompletion=\"false\" ");
    }
    if (!subProcessNode.isIndependent()) {
      xmlDump.append("tns:independent=\"false\" ");
    }
    xmlDump.append(">" + EOL);
    writeIO(subProcessNode, xmlDump);
    endNode("callActivity", xmlDump);
View Full Code Here

                if (milestone.getConstraint() == null) {
                    errors.add( new ProcessValidationErrorImpl(process,
                        "Milestone node '" + node.getName() + "' [" + node.getId() + "] has no constraint."));
                }
            } else if (node instanceof SubProcessNode) {
                final SubProcessNode subProcess = (SubProcessNode) node;
                if (subProcess.getFrom() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection."));
                }
                if (subProcess.getTo() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection."));
                }
                if (subProcess.getProcessId() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "SubProcess node '" + node.getName() + "' [" + node.getId() + "] has no process id."));
                }
            } else if (node instanceof ActionNode) {
                final ActionNode actionNode = (ActionNode) node;
View Full Code Here

        process.addNode( actionNode );
        new ConnectionImpl( start,
                            Node.CONNECTION_DEFAULT_TYPE,
                            actionNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        SubProcessNode subProcessNode = new SubProcessNode();
        subProcessNode.setId( 3 );
        subProcessNode.setName( "SubProcess" );
        subProcessNode.setProcessId( "org.drools.test.SubProcess" );
        process.addNode( subProcessNode );
        new ConnectionImpl( actionNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            subProcessNode,
                            Node.CONNECTION_DEFAULT_TYPE );
View Full Code Here

        process.addNode(new ActionNode());
        process.addNode(new Split());
        process.addNode(new Join());
        process.addNode(new MilestoneNode());
        process.addNode(new RuleSetNode());
        process.addNode(new SubProcessNode());
        process.addNode(new WorkItemNode());
        process.addNode(new TimerNode());
        process.addNode(new HumanTaskNode());
        process.addNode(new ForEachNode());
        process.addNode(new CompositeContextNode());
View Full Code Here

TOP

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

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.