private void throwWorkflowRuntimeException(NodeInstanceContainer nodeInstanceContainer, ProcessInstance processInstance, String msg, Exception e) { if( nodeInstanceContainer instanceof NodeInstance ) { throw new WorkflowRuntimeException((org.kie.api.runtime.process.NodeInstance) nodeInstanceContainer, processInstance, msg, e ); } else { throw new WorkflowRuntimeException(null, processInstance, msg, e ); } } }
public void internalTrigger(final NodeInstance from, String type) { if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "A Split only accepts default incoming connections!"); } final Split split = getSplit(); try { executeStrategy(split, type); } catch(WorkflowRuntimeException wre) { throw wre; } catch(Exception e) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Split: " + e.getMessage(), e); } }
private void handleException(Throwable e) { ExceptionScopeInstance exceptionScopeInstance = getExceptionScopeInstance(e); if(exceptionScopeInstance != null) { exceptionScopeInstance.handleException(e.getClass().getName(), e); return; } else { Throwable rootCause = ExceptionUtils.getRootCause(e); if(rootCause != null) { exceptionScopeInstance = getExceptionScopeInstance(rootCause); if(exceptionScopeInstance != null) { exceptionScopeInstance.handleException(rootCause.getClass().getName(), rootCause); return; } } throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } }
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(); }
/** * This method is used in both instances of the {@link ExtendedNodeInstanceImpl} * and {@link ActionNodeInstance} instances in order to handle * exceptions thrown when executing actions. * * @param action An {@link Action} instance. */ protected void executeAction(Action action) { ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime()); context.setNodeInstance(this); try { action.execute(context); } catch (Exception e) { String exceptionName = e.getClass().getName(); ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } exceptionScopeInstance.handleException(exceptionName, e); cancel(); } }
throw new WorkflowRuntimeException(null, getProcessInstance(), "Compensation can only be triggered with String events, not an event of type " + activityRefStr == null ? "null" : activityRefStr.getClass().getSimpleName());
throw new WorkflowRuntimeException(this, getProcessInstance(), e);
ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute work item " + handlerException.getMessage(), handlerException.getCause());
ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e);
private void throwWorkflowRuntimeException(NodeInstanceContainer nodeInstanceContainer, ProcessInstance processInstance, String msg, Exception e) { if( nodeInstanceContainer instanceof NodeInstance ) { throw new WorkflowRuntimeException((org.kie.api.runtime.process.NodeInstance) nodeInstanceContainer, processInstance, msg, e ); } else { throw new WorkflowRuntimeException(null, processInstance, msg, e ); } } }
public void internalTrigger(final NodeInstance from, String type) { if (!org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) { throw new IllegalArgumentException( "A Split only accepts default incoming connections!"); } final Split split = getSplit(); try { executeStrategy(split, type); } catch(WorkflowRuntimeException wre) { throw wre; } catch(Exception e) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Split: " + e.getMessage(), e); } }
private void handleException(Throwable e) { ExceptionScopeInstance exceptionScopeInstance = getExceptionScopeInstance(e); if(exceptionScopeInstance != null) { exceptionScopeInstance.handleException(e.getClass().getName(), e); return; } else { Throwable rootCause = ExceptionUtils.getRootCause(e); if(rootCause != null) { exceptionScopeInstance = getExceptionScopeInstance(rootCause); if(exceptionScopeInstance != null) { exceptionScopeInstance.handleException(rootCause.getClass().getName(), rootCause); return; } } throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } }
/** * This method is used in both instances of the {@link ExtendedNodeInstanceImpl} * and {@link ActionNodeInstance} instances in order to handle * exceptions thrown when executing actions. * * @param action An {@link Action} instance. */ protected void executeAction(Action action) { ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime()); context.setNodeInstance(this); try { action.execute(context); } catch (Exception e) { String exceptionName = e.getClass().getName(); ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e); } exceptionScopeInstance.handleException(exceptionName, e); cancel(); } }
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(); }
throw new WorkflowRuntimeException(null, getProcessInstance(), "Compensation can only be triggered with String events, not an event of type " + activityRefStr == null ? "null" : activityRefStr.getClass().getSimpleName());
throw new WorkflowRuntimeException(this, getProcessInstance(), e);
ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute work item " + handlerException.getMessage(), handlerException.getCause());
ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance) resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName); if (exceptionScopeInstance == null) { throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e);