Search in sources :

Example 56 with DroolsConsequenceAction

use of org.jbpm.workflow.core.impl.DroolsConsequenceAction in project jbpm by kiegroup.

the class SubProcessNodeFactory method timer.

public SubProcessNodeFactory timer(String delay, String period, String dialect, String action) {
    Timer timer = new Timer();
    timer.setDelay(delay);
    timer.setPeriod(period);
    getSubProcessNode().addTimer(timer, new DroolsConsequenceAction(dialect, action));
    return this;
}
Also used : Timer(org.jbpm.process.core.timer.Timer) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction)

Example 57 with DroolsConsequenceAction

use of org.jbpm.workflow.core.impl.DroolsConsequenceAction in project jbpm by kiegroup.

the class SubProcessNodeFactory method onExitAction.

public SubProcessNodeFactory onExitAction(String dialect, String action) {
    if (getSubProcessNode().getActions(dialect) != null) {
        getSubProcessNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action));
    } else {
        List<DroolsAction> actions = new ArrayList<DroolsAction>();
        actions.add(new DroolsConsequenceAction(dialect, action));
        getSubProcessNode().setActions(MilestoneNode.EVENT_NODE_EXIT, actions);
    }
    return this;
}
Also used : DroolsAction(org.jbpm.workflow.core.DroolsAction) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction) ArrayList(java.util.ArrayList)

Example 58 with DroolsConsequenceAction

use of org.jbpm.workflow.core.impl.DroolsConsequenceAction in project jbpm by kiegroup.

the class WorkItemNodeFactory method onExitAction.

public WorkItemNodeFactory onExitAction(String dialect, String action) {
    if (getWorkItemNode().getActions(dialect) != null) {
        getWorkItemNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action));
    } else {
        List<DroolsAction> actions = new ArrayList<DroolsAction>();
        actions.add(new DroolsConsequenceAction(dialect, action));
        getWorkItemNode().setActions(MilestoneNode.EVENT_NODE_EXIT, actions);
    }
    return this;
}
Also used : DroolsAction(org.jbpm.workflow.core.DroolsAction) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction) ArrayList(java.util.ArrayList)

Example 59 with DroolsConsequenceAction

use of org.jbpm.workflow.core.impl.DroolsConsequenceAction in project jbpm by kiegroup.

the class ActionNodeFactory method action.

public ActionNodeFactory action(String dialect, String action, boolean isDroolsAction) {
    if (isDroolsAction) {
        DroolsAction droolsAction = new DroolsAction();
        droolsAction.setMetaData("Action", action);
        getActionNode().setAction(droolsAction);
    } else {
        getActionNode().setAction(new DroolsConsequenceAction(dialect, action));
    }
    return this;
}
Also used : DroolsAction(org.jbpm.workflow.core.DroolsAction) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction)

Example 60 with DroolsConsequenceAction

use of org.jbpm.workflow.core.impl.DroolsConsequenceAction in project jbpm by kiegroup.

the class HumanTaskNodeFactory method onEntryAction.

public HumanTaskNodeFactory onEntryAction(String dialect, String action) {
    if (getHumanTaskNode().getActions(dialect) != null) {
        getHumanTaskNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action));
    } else {
        List<DroolsAction> actions = new ArrayList<DroolsAction>();
        actions.add(new DroolsConsequenceAction(dialect, action));
        getHumanTaskNode().setActions(MilestoneNode.EVENT_NODE_ENTER, actions);
    }
    return this;
}
Also used : DroolsAction(org.jbpm.workflow.core.DroolsAction) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction) ArrayList(java.util.ArrayList)

Aggregations

DroolsConsequenceAction (org.jbpm.workflow.core.impl.DroolsConsequenceAction)73 ActionNode (org.jbpm.workflow.core.node.ActionNode)41 DroolsAction (org.jbpm.workflow.core.DroolsAction)40 ArrayList (java.util.ArrayList)32 EndNode (org.jbpm.workflow.core.node.EndNode)28 StartNode (org.jbpm.workflow.core.node.StartNode)25 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)24 Action (org.jbpm.process.instance.impl.Action)21 EventTypeFilter (org.jbpm.process.core.event.EventTypeFilter)18 Test (org.junit.Test)18 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)17 ConnectionImpl (org.jbpm.workflow.core.impl.ConnectionImpl)17 KieSession (org.kie.api.runtime.KieSession)17 ProcessContext (org.kie.api.runtime.process.ProcessContext)17 EventNode (org.jbpm.workflow.core.node.EventNode)16 Timer (org.jbpm.process.core.timer.Timer)11 Variable (org.jbpm.process.core.context.variable.Variable)10 ObjectDataType (org.jbpm.process.core.datatype.impl.type.ObjectDataType)10 TestProcessEventListener (org.jbpm.process.test.TestProcessEventListener)9 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)8