private void triggerTimer(TimerInstance timerInstance) { for (Map.Entry<Timer, DroolsAction> entry: getEventBasedNode().getTimers().entrySet()) { if (entry.getKey().getId() == timerInstance.getTimerId()) { executeAction((Action) entry.getValue().getMetaData("Action")); return; } } }
protected void triggerEvent(String type) { ExtendedNodeImpl extendedNode = getExtendedNode(); if (extendedNode == null) { return; } List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { Action action = (Action) droolsAction.getMetaData("Action"); executeAction(action); } } }
public void internalTrigger(final NodeInstance from, String type) { if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "An ActionNode only accepts default incoming connections!"); } Action action = (Action) getActionNode().getAction().getMetaData("Action"); try { ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime()); context.setNodeInstance(this); executeAction(action); } catch( WorkflowRuntimeException wre) { throw wre; } catch (Exception e) { // for the case that one of the following throws an exception // - the ProcessContext() constructor // - or context.setNodeInstance(this) throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } triggerCompleted(); }
public void handleException(ExceptionHandler handler, String exception, Object params) { if (handler instanceof ActionExceptionHandler) { ActionExceptionHandler exceptionHandler = (ActionExceptionHandler) handler; Action action = (Action) exceptionHandler.getAction().getMetaData("Action"); try { ProcessInstance processInstance = getProcessInstance(); ProcessContext processContext = new ProcessContext(processInstance.getKnowledgeRuntime()); ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer(); if (contextInstanceContainer instanceof NodeInstance) { processContext.setNodeInstance((NodeInstance) contextInstanceContainer); } else { processContext.setProcessInstance(processInstance); } String faultVariable = exceptionHandler.getFaultVariable(); if (faultVariable != null) { processContext.setVariable(faultVariable, params); } action.execute(processContext); } catch (Exception e) { throw new RuntimeException("unable to execute Action", e); } } else { throw new IllegalArgumentException("Unknown exception handler " + handler); } }
((MVELAction) actionNode.getAction().getMetaData("Action")).compile( data ); ((Action)actionNode.getAction().getMetaData("Action")).execute( processContext );
((MVELAction) actionNode.getAction().getMetaData("Action")).compile( data ); ((Action) actionNode.getAction().getMetaData("Action")).execute( processContext );
((Action) actionNode.getAction().getMetaData("Action")).execute( processContext );
((Action) actionNode.getAction().getMetaData("Action")).execute(processContext);
private void triggerTimer(TimerInstance timerInstance) { for (Map.Entry<Timer, DroolsAction> entry: getEventBasedNode().getTimers().entrySet()) { if (entry.getKey().getId() == timerInstance.getTimerId()) { executeAction((Action) entry.getValue().getMetaData("Action")); return; } } }
protected void triggerEvent(String type) { ExtendedNodeImpl extendedNode = getExtendedNode(); if (extendedNode == null) { return; } List<DroolsAction> actions = extendedNode.getActions(type); if (actions != null) { for (DroolsAction droolsAction: actions) { Action action = (Action) droolsAction.getMetaData("Action"); executeAction(action); } } }
public void internalTrigger(final NodeInstance from, String type) { if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "An ActionNode only accepts default incoming connections!"); } Action action = (Action) getActionNode().getAction().getMetaData("Action"); try { ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime()); context.setNodeInstance(this); executeAction(action); } catch( WorkflowRuntimeException wre) { throw wre; } catch (Exception e) { // for the case that one of the following throws an exception // - the ProcessContext() constructor // - or context.setNodeInstance(this) throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } triggerCompleted(); }
public void handleException(ExceptionHandler handler, String exception, Object params) { if (handler instanceof ActionExceptionHandler) { ActionExceptionHandler exceptionHandler = (ActionExceptionHandler) handler; Action action = (Action) exceptionHandler.getAction().getMetaData("Action"); try { ProcessInstance processInstance = getProcessInstance(); ProcessContext processContext = new ProcessContext(processInstance.getKnowledgeRuntime()); ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer(); if (contextInstanceContainer instanceof NodeInstance) { processContext.setNodeInstance((NodeInstance) contextInstanceContainer); } else { processContext.setProcessInstance(processInstance); } String faultVariable = exceptionHandler.getFaultVariable(); if (faultVariable != null) { processContext.setVariable(faultVariable, params); } action.execute(processContext); } catch (Exception e) { throw new RuntimeException("unable to execute Action", e); } } else { throw new IllegalArgumentException("Unknown exception handler " + handler); } }