Package org.drools.workflow.core.node

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


        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());
        process.addNode(new EventNode());
        process.addNode(new FaultNode());
View Full Code Here


              if (faultNode.getFaultName() == null) {
                errors.add(new ProcessValidationErrorImpl(process,
                        "Fault node '" + node.getName() + "' [" + node.getId() + "] has no fault name."));
              }
            } else if (node instanceof TimerNode) {
              TimerNode timerNode = (TimerNode) node;
                if (timerNode.getFrom() == null && !acceptsNoIncomingConnections(node)) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Timer node '" + node.getName() + "' [" + node.getId() + "] has no incoming connection."));
                }
                if (timerNode.getTo() == null && !acceptsNoOutgoingConnections(node)) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Timer node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection."));
                }
                if (timerNode.getTimer() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Timer node '" + node.getName() + "' [" + node.getId() + "] has no timer specified."));
                } else {
                  validateTimer(timerNode.getTimer(), node, process, errors);
                }
            } else {
              errors.add(new ProcessValidationErrorImpl(process,
                    "Unknown node type '" + node.getClass().getName() + "'"));
            }
View Full Code Here

        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());
        process.addNode(new EventNode());
        process.addNode(new FaultNode());
View Full Code Here

        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, actions);
        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions);
        process.addNode(humanTaskNode);
        connection = new ConnectionImpl(workItemNode, Node.CONNECTION_DEFAULT_TYPE, humanTaskNode, Node.CONNECTION_DEFAULT_TYPE);
       
        TimerNode timerNode = new TimerNode();
        timerNode.setName("timer");
        timerNode.setMetaData("x", 1);
        timerNode.setMetaData("y", 2);
        timerNode.setMetaData("width", 3);
        timerNode.setMetaData("height", 4);
        timer = new Timer();
        timer.setDelay(1000);
        timer.setPeriod(1000);
        timerNode.setTimer(timer);
        process.addNode(timerNode);
        new ConnectionImpl(humanTaskNode, Node.CONNECTION_DEFAULT_TYPE, timerNode, Node.CONNECTION_DEFAULT_TYPE);
       
        ForEachNode forEachNode = new ForEachNode();
        forEachNode.setName("ForEach");
View Full Code Here

        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());
        process.addNode(new EventNode());
        process.addNode(new FaultNode());
View Full Code Here

        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, actions);
        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions);
        process.addNode(humanTaskNode);
        connection = new ConnectionImpl(workItemNode, Node.CONNECTION_DEFAULT_TYPE, humanTaskNode, Node.CONNECTION_DEFAULT_TYPE);
       
        TimerNode timerNode = new TimerNode();
        timerNode.setName("timer");
        timerNode.setMetaData("x", 1);
        timerNode.setMetaData("y", 2);
        timerNode.setMetaData("width", 3);
        timerNode.setMetaData("height", 4);
        timer = new Timer();
        timer.setDelay(1000);
        timer.setPeriod(1000);
        timerNode.setTimer(timer);
        process.addNode(timerNode);
        new ConnectionImpl(humanTaskNode, Node.CONNECTION_DEFAULT_TYPE, timerNode, Node.CONNECTION_DEFAULT_TYPE);
       
        ForEachNode forEachNode = new ForEachNode();
        forEachNode.setName("ForEach");
View Full Code Here

import org.xml.sax.SAXException;

public class TimerNodeHandler extends AbstractNodeHandler {

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

    public 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);
        TimerNode timerNode = (TimerNode) node;
        String delay = element.getAttribute("delay");
        String period = element.getAttribute("period");
        if ((delay != null && delay.length() > 0) || (period != null && period.length() > 0)) {
            Timer timer = timerNode.getTimer();
            if (timer == null) {
                timer = new Timer();
                timerNode.setTimer(timer);
            }
            if (delay != null && delay.length() != 0 ) {
                timer.setDelay(delay);
            }
            if (period != null && period.length() != 0 ) {
View Full Code Here

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

  public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    TimerNode timerNode = (TimerNode) node;
    writeNode("timerNode", timerNode, xmlDump, includeMeta);
        Timer timer = timerNode.getTimer();
        if (timer != null) {
            xmlDump.append("delay=\"" + timer.getDelay() + "\" ");
            if (timer.getPeriod() != null) {
                xmlDump.append(" period=\"" + timer.getPeriod() + "\" ");
            }
View Full Code Here

        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        TimerNode timerNode = new TimerNode();
        timerNode.setId( 2 );
        timerNode.setName( "Timer" );
        Timer timer = new Timer();
        timer.setDelay( 0 );
        timerNode.setTimer( timer );
        process.addNode( timerNode );
        new ConnectionImpl( start,
                            Node.CONNECTION_DEFAULT_TYPE,
                            timerNode,
                            Node.CONNECTION_DEFAULT_TYPE );
View Full Code Here

TOP

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

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.