Package org.drools.workflow.core.node

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


                                                                        rule0,
                                                                        null,
                                                                        null );

        // nodes
        final StartNode start = new StartNode();
        start.setId(1);
        final RuleSetNode ruleSet0 = new RuleSetNode();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        ruleSet0.setId(2);
        final RuleSetNode ruleSet1 = new RuleSetNode();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
View Full Code Here


                                                     milestone ) );
            } else if ( nodes[i] instanceof StateNode ) {
                StateNode state = (StateNode) nodes[i];
                builder.append( createStateRules(process, state) );
            } else if ( nodes[i] instanceof StartNode ) {
                StartNode startNode = (StartNode) nodes[i];
                List<Trigger> triggers = startNode.getTriggers();
                if ( triggers != null ) {
                    for ( Trigger trigger : triggers ) {
                        if ( trigger instanceof ConstraintTrigger ) {
                            builder.append( createStartConstraintRule( process,
                                                                       (ConstraintTrigger) trigger ) );
View Full Code Here

import org.drools.xml.XmlDumper;

public class StartNodeHandler extends AbstractNodeHandler {
   
    protected Node createNode() {
        return new StartNode();
    }
View Full Code Here

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

  public void writeNode(Node node, StringBuffer xmlDump, boolean includeMeta) {
    StartNode startNode = (StartNode) node;
    writeNode("start", startNode, xmlDump, includeMeta);
    List<Trigger> triggers = startNode.getTriggers();
    if (triggers == null || triggers.isEmpty()) {
      endNode(xmlDump);
    } else {
      xmlDump.append(">" + EOL);
      xmlDump.append("        <triggers>" + EOL);
View Full Code Here

                } else if ( nodes[i] instanceof MilestoneNode ) {
                    MilestoneNode milestone = (MilestoneNode) nodes[i];
                    builder.append( createMilestoneRule( process,
                                                         milestone ) );
                } else if ( nodes[i] instanceof StartNode ) {
                    StartNode startNode = (StartNode) nodes[i];
                    List<Trigger> triggers = startNode.getTriggers();
                    if ( triggers != null ) {
                        for ( Trigger trigger : triggers ) {
                            if ( trigger instanceof ConstraintTrigger ) {
                                builder.append( createStartConstraintRule( process,
                                                                           (ConstraintTrigger) trigger ) );
View Full Code Here

            public void addNode(org.drools.definition.process.Node node) {
                ((Node) node).setId(++id);
                super.addNode(node);
            }
        };
        process.addNode(new StartNode());
        process.addNode(new EndNode());
        process.addNode(new ActionNode());
        process.addNode(new Split());
        process.addNode(new Join());
        process.addNode(new MilestoneNode());
View Full Code Here

        exceptionHandler.setFaultVariable("faultVariable2");
        action = new DroolsConsequenceAction("dialect2", "consequence2");
        exceptionHandler.setAction(action);
        process.getExceptionScope().setExceptionHandler("myFault2", exceptionHandler);
       
        StartNode startNode = new StartNode();
        startNode.setName("start");
        startNode.setMetaData("x", 1);
        startNode.setMetaData("y", 2);
        startNode.setMetaData("width", 3);
        startNode.setMetaData("height", 4);
        startNode.setMetaData("meta1", "someValue");
        startNode.setMetaData("meta2", "someOtherValue");
        ConstraintTrigger constraintTrigger = new ConstraintTrigger();
        constraintTrigger.setConstraint("constraint");
        Map<String, String> inMapping = new HashMap<String, String>();
        inMapping.put("key", "value");
        inMapping.put("key2", "value2");
        constraintTrigger.setInMappings(inMapping);
        startNode.addTrigger(constraintTrigger);
        EventTrigger eventTrigger = new EventTrigger();
        EventTypeFilter eventTypeFilter = new EventTypeFilter();
        eventTypeFilter.setType("eventType");
        eventTrigger.addEventFilter(eventTypeFilter);
        inMapping = new HashMap<String, String>();
        inMapping.put("key", "value");
        inMapping.put("key2", "value2");
        eventTrigger.setInMappings(inMapping);
        startNode.addTrigger(eventTrigger);
        process.addNode(startNode);
       
        ActionNode actionNode = new ActionNode();
        actionNode.setName("action");
        actionNode.setMetaData("x", 1);
View Full Code Here

    }

  private void initProcessEventListeners() {
    for (Process process: ruleBase.getProcesses()) {
      if (process instanceof RuleFlowProcess) {
        StartNode startNode = ((RuleFlowProcess) process).getStart();
        List<Trigger> triggers = startNode.getTriggers();
        if (triggers != null) {
          for (Trigger trigger: triggers) {
            if (trigger instanceof EventTrigger) {
              final List<EventFilter> filters = ((EventTrigger) trigger).getEventFilters();
              String type = null;
View Full Code Here

   
    private void validateNodes(Node[] nodes, List<ProcessValidationError> errors, RuleFlowProcess process) {
        for ( int i = 0; i < nodes.length; i++ ) {
            final Node node = nodes[i];
            if (node instanceof StartNode) {
                final StartNode startNode = (StartNode) node;
                startNodeFound = true;
                if (startNode.getTo() == null) {
                    errors.add(new ProcessValidationErrorImpl(process,
                        "Start node '" + node.getName() + "' [" + node.getId() + "] has no outgoing connection."));
                }
            } else if (node instanceof EndNode) {
                final EndNode endNode = (EndNode) node;
View Full Code Here

    private StartNodeFactory(NodeContainer nodeContainer, long id) {
      super(nodeContainer, id);
    }
   
    protected org.drools.workflow.core.Node createNode() {
      return new StartNode();
    }
View Full Code Here

TOP

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

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.