Search in sources :

Example 46 with DroolsAction

use of org.jbpm.workflow.core.DroolsAction 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 47 with DroolsAction

use of org.jbpm.workflow.core.DroolsAction 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 48 with DroolsAction

use of org.jbpm.workflow.core.DroolsAction 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)

Example 49 with DroolsAction

use of org.jbpm.workflow.core.DroolsAction in project jbpm by kiegroup.

the class HumanTaskNodeFactory method onExitAction.

public HumanTaskNodeFactory onExitAction(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_EXIT, actions);
    }
    return this;
}
Also used : DroolsAction(org.jbpm.workflow.core.DroolsAction) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction) ArrayList(java.util.ArrayList)

Example 50 with DroolsAction

use of org.jbpm.workflow.core.DroolsAction in project jbpm by kiegroup.

the class MilestoneNodeFactory method onEntryAction.

public MilestoneNodeFactory onEntryAction(String dialect, String action) {
    if (getMilestoneNode().getActions(dialect) != null) {
        getMilestoneNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action));
    } else {
        List<DroolsAction> actions = new ArrayList<DroolsAction>();
        actions.add(new DroolsConsequenceAction(dialect, action));
        getMilestoneNode().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

DroolsAction (org.jbpm.workflow.core.DroolsAction)53 DroolsConsequenceAction (org.jbpm.workflow.core.impl.DroolsConsequenceAction)40 ArrayList (java.util.ArrayList)30 ActionNode (org.jbpm.workflow.core.node.ActionNode)25 Action (org.jbpm.process.instance.impl.Action)22 EndNode (org.jbpm.workflow.core.node.EndNode)22 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)19 Test (org.junit.Test)18 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)17 StartNode (org.jbpm.workflow.core.node.StartNode)17 KieSession (org.kie.api.runtime.KieSession)17 ProcessContext (org.kie.api.runtime.process.ProcessContext)17 EventTypeFilter (org.jbpm.process.core.event.EventTypeFilter)15 EventNode (org.jbpm.workflow.core.node.EventNode)14 ConnectionImpl (org.jbpm.workflow.core.impl.ConnectionImpl)13 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 InternalKnowledgePackage (org.drools.core.definitions.InternalKnowledgePackage)8 KnowledgePackageImpl (org.drools.core.definitions.impl.KnowledgePackageImpl)8