private static void linkBoundarySignalEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode)node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundarySignalEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryConditionEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { String processId = ((RuleFlowProcess) nodeContainer).getId(); String eventType = "RuleFlowStateEvent-" + processId + "-" + ((EventNode) node).getUniqueId() + "-" + attachedTo; ((EventTypeFilter) ((EventNode) node).getEventFilters().get(0)).setType(eventType); boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryConditionEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { String processId = ((RuleFlowProcess) nodeContainer).getId(); String eventType = "RuleFlowStateEvent-" + processId + "-" + ((EventNode) node).getUniqueId() + "-" + attachedTo; ((EventTypeFilter) ((EventNode) node).getEventFilters().get(0)).setType(eventType); boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode)node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryErrorEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { ContextContainer compositeNode = (ContextContainer) attachedNode; ExceptionScope exceptionScope = (ExceptionScope) compositeNode.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScope == null) { exceptionScope = new ExceptionScope(); compositeNode.addContext(exceptionScope); compositeNode.setDefaultContext(exceptionScope); } String errorCode = (String) node.getMetaData().get("ErrorEvent"); boolean hasErrorCode = (Boolean) node.getMetaData().get("HasErrorEvent"); String errorStructureRef = (String) node.getMetaData().get("ErrorStructureRef"); ActionExceptionHandler exceptionHandler = new ActionExceptionHandler(); String variable = ((EventNode) node).getVariableName(); DroolsConsequenceAction action = new DroolsConsequenceAction("java", PROCESS_INSTANCE_SIGNAL_EVENT + "Error-" + attachedTo + "-" + errorCode + "\", kcontext.getVariable(\"" + variable + "\"));"); exceptionHandler.setAction(action); exceptionHandler.setFaultVariable(variable); exceptionScope.setExceptionHandler(hasErrorCode ? errorCode : null, exceptionHandler); if (errorStructureRef != null) { exceptionScope.setExceptionHandler(errorStructureRef, exceptionHandler); } List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction cancelAction = new DroolsConsequenceAction("java", null); cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); }
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions);
private static void linkBoundarySignalEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundarySignalEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode)node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryConditionEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { String processId = ((RuleFlowProcess) nodeContainer).getId(); String eventType = "RuleFlowStateEvent-" + processId + "-" + ((EventNode) node).getUniqueId() + "-" + attachedTo; ((EventTypeFilter) ((EventNode) node).getEventFilters().get(0)).setType(eventType); boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode)node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryConditionEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { String processId = ((RuleFlowProcess) nodeContainer).getId(); String eventType = "RuleFlowStateEvent-" + processId + "-" + ((EventNode) node).getUniqueId() + "-" + attachedTo; ((EventTypeFilter) ((EventNode) node).getEventFilters().get(0)).setType(eventType); boolean cancelActivity = (Boolean) node.getMetaData().get("CancelActivity"); if (cancelActivity) { List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction action = new DroolsConsequenceAction("java", null); action.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(action); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); } }
private static void linkBoundaryErrorEvent(NodeContainer nodeContainer, Node node, String attachedTo, Node attachedNode) { ContextContainer compositeNode = (ContextContainer) attachedNode; ExceptionScope exceptionScope = (ExceptionScope) compositeNode.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScope == null) { exceptionScope = new ExceptionScope(); compositeNode.addContext(exceptionScope); compositeNode.setDefaultContext(exceptionScope); } String errorCode = (String) node.getMetaData().get("ErrorEvent"); boolean hasErrorCode = (Boolean) node.getMetaData().get("HasErrorEvent"); String errorStructureRef = (String) node.getMetaData().get("ErrorStructureRef"); ActionExceptionHandler exceptionHandler = new ActionExceptionHandler(); String variable = ((EventNode) node).getVariableName(); DroolsConsequenceAction action = new DroolsConsequenceAction("java", PROCESS_INSTANCE_SIGNAL_EVENT + "Error-" + attachedTo + "-" + errorCode + "\", kcontext.getVariable(\"" + variable + "\"));"); exceptionHandler.setAction(action); exceptionHandler.setFaultVariable(variable); exceptionScope.setExceptionHandler(hasErrorCode ? errorCode : null, exceptionHandler); if (errorStructureRef != null) { exceptionScope.setExceptionHandler(errorStructureRef, exceptionHandler); } List<DroolsAction> actions = ((EventNode) node).getActions(EndNode.EVENT_NODE_EXIT); if (actions == null) { actions = new ArrayList<DroolsAction>(); } DroolsConsequenceAction cancelAction = new DroolsConsequenceAction("java", null); cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions); }
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode)node).setActions(EndNode.EVENT_NODE_EXIT, actions);
cancelAction.setMetaData("Action", new CancelNodeInstanceAction(attachedTo)); actions.add(cancelAction); ((EventNode) node).setActions(EndNode.EVENT_NODE_EXIT, actions);