Search in sources :

Example 26 with RuleFlowProcess

use of org.jbpm.ruleflow.core.RuleFlowProcess in project jbpm by kiegroup.

the class CompensationTest method testCompensationEventSubProcessSpecific.

@Test
public void testCompensationEventSubProcessSpecific() throws Exception {
    String processId = "org.jbpm.process.compensation.event.subprocess";
    String[] workItemNames = { "kwik", "kwek", "kwak" };
    List<String> eventList = new ArrayList<String>();
    RuleFlowProcess process = createCompensationEventSubProcessProcess(processId, workItemNames, eventList);
    Node toCompensateNode = findNode(process, "sub0");
    String compensationEvent = (String) toCompensateNode.getMetaData().get("UniqueId");
    // run process
    ksession = createKieSession(process);
    runCompensationEventSubProcessSpecificTest(ksession, process, processId, workItemNames, eventList, compensationEvent);
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) BoundaryEventNode(org.jbpm.workflow.core.node.BoundaryEventNode) StartNode(org.jbpm.workflow.core.node.StartNode) CompositeNode(org.jbpm.workflow.core.node.CompositeNode) EventSubProcessNode(org.jbpm.workflow.core.node.EventSubProcessNode) WorkItemNode(org.jbpm.workflow.core.node.WorkItemNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) Node(org.jbpm.workflow.core.Node) ArrayList(java.util.ArrayList) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 27 with RuleFlowProcess

use of org.jbpm.ruleflow.core.RuleFlowProcess in project jbpm by kiegroup.

the class CompensationTest method testNestedCompensationBoundaryEventSpecific.

@Test
public void testNestedCompensationBoundaryEventSpecific() throws Exception {
    String processId = "org.jbpm.process.compensation.boundary.nested";
    String[] workItemNames = { "Don-Quixote", "Sancho", "Ricote" };
    List<String> eventList = new ArrayList<String>();
    RuleFlowProcess process = createNestedCompensationBoundaryEventProcess(processId, workItemNames, eventList);
    // run process
    ksession = createKieSession(process);
    Node compensatedNode = findNode(process, "work-comp-1");
    String compensationEvent = (String) compensatedNode.getMetaData().get("UniqueId");
    runCompensationBoundaryEventSpecificTest(ksession, process, processId, workItemNames, eventList, compensationEvent);
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) BoundaryEventNode(org.jbpm.workflow.core.node.BoundaryEventNode) StartNode(org.jbpm.workflow.core.node.StartNode) CompositeNode(org.jbpm.workflow.core.node.CompositeNode) EventSubProcessNode(org.jbpm.workflow.core.node.EventSubProcessNode) WorkItemNode(org.jbpm.workflow.core.node.WorkItemNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) Node(org.jbpm.workflow.core.Node) ArrayList(java.util.ArrayList) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 28 with RuleFlowProcess

use of org.jbpm.ruleflow.core.RuleFlowProcess in project jbpm by kiegroup.

the class CompensationTest method testCompensationEventSubProcessGeneral.

@Test
public void testCompensationEventSubProcessGeneral() throws Exception {
    String processId = "org.jbpm.process.compensation.event.subprocess.general";
    String[] workItemNames = { "kwik", "kwek", "kwak" };
    List<String> eventList = new ArrayList<String>();
    RuleFlowProcess process = createCompensationEventSubProcessProcess(processId, workItemNames, eventList);
    String compensationEvent = CompensationScope.IMPLICIT_COMPENSATION_PREFIX + process.getId();
    // run process
    ksession = createKieSession(process);
    runCompensationEventSubProcessGeneralTest(ksession, process, processId, workItemNames, eventList, compensationEvent);
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) ArrayList(java.util.ArrayList) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 29 with RuleFlowProcess

use of org.jbpm.ruleflow.core.RuleFlowProcess in project jbpm by kiegroup.

the class CompensationTest method testCompensationBoundaryEventSpecific.

/*
     * TESTS
     */
@Test
public void testCompensationBoundaryEventSpecific() throws Exception {
    String processId = "org.jbpm.process.compensation.boundary";
    String[] workItemNames = { "Don-Quixote", "Sancho", "Ricote" };
    List<String> eventList = new ArrayList<String>();
    RuleFlowProcess process = createCompensationBoundaryEventProcess(processId, workItemNames, eventList);
    // run process
    ksession = createKieSession(process);
    Node compensatedNode = findNode(process, "work1");
    String compensationEvent = (String) compensatedNode.getMetaData().get("UniqueId");
    runCompensationBoundaryEventSpecificTest(ksession, process, processId, workItemNames, eventList, compensationEvent);
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) BoundaryEventNode(org.jbpm.workflow.core.node.BoundaryEventNode) StartNode(org.jbpm.workflow.core.node.StartNode) CompositeNode(org.jbpm.workflow.core.node.CompositeNode) EventSubProcessNode(org.jbpm.workflow.core.node.EventSubProcessNode) WorkItemNode(org.jbpm.workflow.core.node.WorkItemNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) Node(org.jbpm.workflow.core.Node) ArrayList(java.util.ArrayList) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 30 with RuleFlowProcess

use of org.jbpm.ruleflow.core.RuleFlowProcess in project jbpm by kiegroup.

the class CompensationTest method testNestedCompensationEventSubProcessGeneral.

@Test
public void testNestedCompensationEventSubProcessGeneral() throws Exception {
    String processId = "org.jbpm.process.compensation.event.subprocess.general";
    String[] workItemNames = { "apple", "banana", "orange" };
    List<String> eventList = new ArrayList<String>();
    RuleFlowProcess process = createNestedCompensationEventSubProcessProcess(processId, workItemNames, eventList);
    Node toCompensateNode = findNode(process, "sub0");
    String compensationEvent = CompensationScope.IMPLICIT_COMPENSATION_PREFIX + toCompensateNode.getMetaData().get("UniqueId");
    ksession = createKieSession(process);
    runCompensationEventSubProcessGeneralTest(ksession, process, processId, workItemNames, eventList, compensationEvent);
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) BoundaryEventNode(org.jbpm.workflow.core.node.BoundaryEventNode) StartNode(org.jbpm.workflow.core.node.StartNode) CompositeNode(org.jbpm.workflow.core.node.CompositeNode) EventSubProcessNode(org.jbpm.workflow.core.node.EventSubProcessNode) WorkItemNode(org.jbpm.workflow.core.node.WorkItemNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) Node(org.jbpm.workflow.core.Node) ArrayList(java.util.ArrayList) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Aggregations

RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)85 Test (org.junit.Test)47 ArrayList (java.util.ArrayList)38 StartNode (org.jbpm.workflow.core.node.StartNode)38 EndNode (org.jbpm.workflow.core.node.EndNode)37 ActionNode (org.jbpm.workflow.core.node.ActionNode)33 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)32 DroolsConsequenceAction (org.jbpm.workflow.core.impl.DroolsConsequenceAction)24 KieSession (org.kie.api.runtime.KieSession)20 DroolsAction (org.jbpm.workflow.core.DroolsAction)19 ConnectionImpl (org.jbpm.workflow.core.impl.ConnectionImpl)19 WorkItemNode (org.jbpm.workflow.core.node.WorkItemNode)19 EventTypeFilter (org.jbpm.process.core.event.EventTypeFilter)17 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)17 Variable (org.jbpm.process.core.context.variable.Variable)16 ObjectDataType (org.jbpm.process.core.datatype.impl.type.ObjectDataType)16 Action (org.jbpm.process.instance.impl.Action)16 CompositeNode (org.jbpm.workflow.core.node.CompositeNode)16 ProcessContext (org.kie.api.runtime.process.ProcessContext)16 KieBase (org.kie.api.KieBase)15