Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.sonatype.sisu.flow;
- import org.drools.ruleflow.core.RuleFlowProcess;
- import org.drools.ruleflow.core.RuleFlowProcessFactory;
- public class Flow
- {
- private RuleFlowProcessFactory factory;
- private int nodeCount = 2;
- public Flow( String flowId )
- {
- factory = RuleFlowProcessFactory.createProcess( flowId );
- factory.name( flowId ).packageName("org.sonatype.release");
- factory.startNode(1).name("Start").done();
- }
- public Flow action( SisuFlowAction action )
- {
- factory.actionNode(nodeCount).action( action ).done();
- factory.connection( nodeCount-1, nodeCount );
- nodeCount++;
- return this;
- }
- public RuleFlowProcess flow()
- {
- factory.endNode(nodeCount).name("End").done();
- factory.connection( nodeCount-1, nodeCount );
- return factory.validate().getProcess();
- }
- }
Add Comment
Please, Sign In to add comment