use of io.automatiko.engine.workflow.process.core.ProcessAction in project automatiko-engine by automatiko-io.
the class EndNodeFactory method action.
public EndNodeFactory action(Action action) {
ProcessAction processAction = new ProcessAction();
processAction.setMetaData(ACTION, action);
List<ProcessAction> enterActions = getEndNode().getActions(ExtendedNodeImpl.EVENT_NODE_ENTER);
if (enterActions == null) {
enterActions = new ArrayList<>();
getEndNode().setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, enterActions);
}
enterActions.add(processAction);
return this;
}
use of io.automatiko.engine.workflow.process.core.ProcessAction in project automatiko-engine by automatiko-io.
the class ExtendedNodeFactory method onEntryAction.
public ExtendedNodeFactory onEntryAction(String dialect, String action) {
if (getExtendedNode().getActions(dialect) != null) {
getExtendedNode().getActions(dialect).add(new ConsequenceAction(dialect, action));
} else {
List<ProcessAction> actions = new ArrayList<>();
actions.add(new ConsequenceAction(dialect, action));
getExtendedNode().setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, actions);
}
return this;
}
use of io.automatiko.engine.workflow.process.core.ProcessAction in project automatiko-engine by automatiko-io.
the class ExtendedNodeFactory method onExitAction.
public ExtendedNodeFactory onExitAction(String dialect, String action) {
if (getExtendedNode().getActions(dialect) != null) {
getExtendedNode().getActions(dialect).add(new ConsequenceAction(dialect, action));
} else {
List<ProcessAction> actions = new ArrayList<>();
actions.add(new ConsequenceAction(dialect, action));
getExtendedNode().setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions);
}
return this;
}
use of io.automatiko.engine.workflow.process.core.ProcessAction in project automatiko-engine by automatiko-io.
the class ExecutableProcessFactory method linkBoundaryTimerEvent.
protected void linkBoundaryTimerEvent(Node node, String attachedTo, Node attachedNode) {
boolean cancelActivity = (Boolean) node.getMetaData().get(CANCEL_ACTIVITY);
StateBasedNode compositeNode = (StateBasedNode) attachedNode;
String timeDuration = (String) node.getMetaData().get(TIME_DURATION);
String timeCycle = (String) node.getMetaData().get(TIME_CYCLE);
String timeDate = (String) node.getMetaData().get(TIME_DATE);
Timer timer = new Timer();
if (timeDuration != null) {
timer.setDelay(timeDuration);
timer.setTimeType(Timer.TIME_DURATION);
compositeNode.addTimer(timer, timerAction("Timer-" + attachedTo + "-" + timeDuration + "-" + node.getId()));
} else if (timeCycle != null) {
int index = timeCycle.indexOf("###");
if (index != -1) {
String period = timeCycle.substring(index + 3);
timeCycle = timeCycle.substring(0, index);
timer.setPeriod(period);
}
timer.setDelay(timeCycle);
timer.setTimeType(Timer.TIME_CYCLE);
compositeNode.addTimer(timer, timerAction("Timer-" + attachedTo + "-" + timeCycle + (timer.getPeriod() == null ? "" : "###" + timer.getPeriod()) + "-" + node.getId()));
} else if (timeDate != null) {
timer.setDate(timeDate);
timer.setTimeType(Timer.TIME_DATE);
compositeNode.addTimer(timer, timerAction("Timer-" + attachedTo + "-" + timeDate + "-" + node.getId()));
}
if (cancelActivity) {
List<ProcessAction> actions = ((EventNode) node).getActions(EVENT_NODE_EXIT);
if (actions == null) {
actions = new ArrayList<>();
}
ConsequenceAction cancelAction = new ConsequenceAction("java", null);
cancelAction.setMetaData(ACTION, new CancelNodeInstanceAction(attachedTo));
actions.add(cancelAction);
((EventNode) node).setActions(EVENT_NODE_EXIT, actions);
}
}
use of io.automatiko.engine.workflow.process.core.ProcessAction in project automatiko-engine by automatiko-io.
the class ActionNodeFactory method action.
public ActionNodeFactory action(String dialect, String action, boolean isprocessAction) {
if (isprocessAction) {
ProcessAction processAction = new ProcessAction();
processAction.setMetaData(ACTION, action);
getActionNode().setAction(processAction);
} else {
getActionNode().setAction(new ConsequenceAction(dialect, action));
}
return this;
}
Aggregations