public void buttonClick(ClickEvent event) { try { managementService.executeJob(job.getId()); jobPage.refreshSelectNext(); } catch (ActivitiException ae) { String errorMessage = ae.getMessage() + (ae.getCause() != null ? " (" + ae.getCause().getClass().getName() + ")" : ""); notificationManager.showErrorNotification(Messages.JOB_ERROR, errorMessage); // Refresh the current job jobPage.refreshCurrentJobDetails(); } } });
public void execute(ActivityExecution execution) throws Exception { ScriptingEngines scriptingEngines = Context .getProcessEngineConfiguration() .getScriptingEngines(); boolean noErrors = true; try { Object result = scriptingEngines.evaluate(script, language, execution, storeScriptVariables); if (resultVariable != null) { execution.setVariable(resultVariable, result); } } catch (ActivitiException e) { LOGGER.warn("Exception while executing " + execution.getActivity().getId() + " : " + e.getMessage()); noErrors = false; if (e.getCause() instanceof ScriptException && e.getCause().getCause() instanceof ScriptException && e.getCause().getCause().getCause() instanceof BpmnError) { ErrorPropagation.propagateError((BpmnError) e.getCause().getCause().getCause(), execution); } else { throw e; } } if (noErrors) { leave(execution); } }
protected void handleActivitiException(org.activiti.engine.ActivitiException e) { if (e instanceof org.activiti.engine.delegate.BpmnError) { org.activiti.engine.delegate.BpmnError activiti5BpmnError = (org.activiti.engine.delegate.BpmnError) e; throw new BpmnError(activiti5BpmnError.getErrorCode(), activiti5BpmnError.getMessage()); } else if (e instanceof org.activiti.engine.ActivitiClassLoadingException) { throw new FlowableClassLoadingException(e.getMessage(), e.getCause()); } else if (e instanceof org.activiti.engine.ActivitiObjectNotFoundException) { org.activiti.engine.ActivitiObjectNotFoundException activiti5ObjectNotFoundException = (org.activiti.engine.ActivitiObjectNotFoundException) e; throw new FlowableObjectNotFoundException(activiti5ObjectNotFoundException.getMessage(), activiti5ObjectNotFoundException.getObjectClass(), activiti5ObjectNotFoundException.getCause()); } else if (e instanceof org.activiti.engine.ActivitiOptimisticLockingException) { throw new FlowableOptimisticLockingException(e.getMessage()); } else if (e instanceof org.activiti.engine.ActivitiIllegalArgumentException) { throw new FlowableIllegalArgumentException(e.getMessage(), e.getCause()); } else { if (e.getCause() instanceof org.activiti.engine.ActivitiClassLoadingException) { throw new FlowableException(e.getMessage(), new FlowableClassLoadingException(e.getCause().getMessage(), e.getCause().getCause())); } else if (e.getCause() instanceof org.activiti.engine.ActivitiException) { throw new FlowableException(e.getMessage(), new FlowableException(e.getCause().getMessage(), e.getCause().getCause())); } else { throw new FlowableException(e.getMessage(), e.getCause()); } } }