JSONObject errorEventDefinitionJSON = new JSONObject(); if (errorEventDefinition.getErrorCode() != null) errorEventDefinitionJSON.put("errorCode", errorEventDefinition.getErrorCode()); else errorEventDefinitionJSON.put("errorCode",null); errorEventDefinition.getHandlerActivityId());
public int compare(ErrorEventDefinition o1, ErrorEventDefinition o2) { return o2.getPrecedence().compareTo(o1.getPrecedence()); } };
private static String findLocalErrorEventHandler(ActivityExecution execution, String errorCode) { PvmScope scope = execution.getActivity(); while (scope != null) { @SuppressWarnings("unchecked") List<ErrorEventDefinition> definitions = (List<ErrorEventDefinition>) scope.getProperty(BpmnParse.PROPERTYNAME_ERROR_EVENT_DEFINITIONS); if(definitions != null) { // definitions are sorted by precedence, ie. event subprocesses first. for (ErrorEventDefinition errorEventDefinition : definitions) { if(errorEventDefinition.catches(errorCode)) { return scope.findActivity(errorEventDefinition.getHandlerActivityId()).getId(); } } } // search for error handlers in parent scopes if (scope instanceof PvmActivity) { scope = ((PvmActivity) scope).getParent(); } else { scope = null; } } return null; }
protected void createErrorStartEventDefinition(ErrorEventDefinition errorEventDefinition, ActivityImpl startEventActivity, ScopeImpl scope) { org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(startEventActivity.getId()); if (StringUtils.isNotEmpty(errorEventDefinition.getErrorCode())) { definition.setErrorCode(errorEventDefinition.getErrorCode()); } definition.setPrecedence(10); addErrorEventDefinition(definition, scope); }
public void createBoundaryErrorEventDefinition(org.activiti.bpmn.model.ErrorEventDefinition errorEventDefinition, boolean interrupting, ActivityImpl activity, ActivityImpl nestedErrorEventActivity) { nestedErrorEventActivity.setProperty("type", "boundaryError"); ScopeImpl catchingScope = nestedErrorEventActivity.getParent(); ((ActivityImpl) catchingScope).setScope(true); org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(nestedErrorEventActivity.getId()); definition.setErrorCode(errorEventDefinition.getErrorCode()); addErrorEventDefinition(definition, catchingScope); }
private static String findLocalErrorEventHandler(ActivityExecution execution, String errorCode) { PvmScope scope = execution.getActivity(); while (scope != null) { @SuppressWarnings("unchecked") List<ErrorEventDefinition> definitions = (List<ErrorEventDefinition>) scope.getProperty(BpmnParse.PROPERTYNAME_ERROR_EVENT_DEFINITIONS); if (definitions != null) { // definitions are sorted by precedence, ie. event subprocesses first. for (ErrorEventDefinition errorEventDefinition : definitions) { if (errorEventDefinition.catches(errorCode)) { return scope.findActivity(errorEventDefinition.getHandlerActivityId()).getId(); } } } // search for error handlers in parent scopes if (scope instanceof PvmActivity) { scope = ((PvmActivity) scope).getParent(); } else { scope = null; } } return null; }
protected void createErrorStartEventDefinition(org.activiti.bpmn.model.ErrorEventDefinition errorEventDefinition, ActivityImpl startEventActivity, ScopeImpl scope) { org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(startEventActivity.getId()); if (StringUtils.isNotEmpty(errorEventDefinition.getErrorCode())) { definition.setErrorCode(errorEventDefinition.getErrorCode()); } definition.setPrecedence(10); addErrorEventDefinition(definition, scope); }
public void createBoundaryErrorEventDefinition(ErrorEventDefinition errorEventDefinition, boolean interrupting, ActivityImpl activity, ActivityImpl nestedErrorEventActivity) { nestedErrorEventActivity.setProperty("type", "boundaryError"); ScopeImpl catchingScope = nestedErrorEventActivity.getParent(); ((ActivityImpl) catchingScope).setScope(true); org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition definition = new org.activiti.engine.impl.bpmn.parser.ErrorEventDefinition(nestedErrorEventActivity.getId()); definition.setErrorCode(errorEventDefinition.getErrorCode()); addErrorEventDefinition(definition, catchingScope); }
ObjectNode errorEventDefinitionJSON = new ObjectMapper().createObjectNode(); if (errorEventDefinition.getErrorCode() != null) errorEventDefinitionJSON.put("errorCode", errorEventDefinition.getErrorCode()); else errorEventDefinitionJSON.putNull("errorCode"); errorEventDefinition.getHandlerActivityId());
@Override public int compare(ErrorEventDefinition o1, ErrorEventDefinition o2) { return o2.getPrecedence().compareTo(o1.getPrecedence()); } };
ObjectNode errorEventDefinitionJSON = new ObjectMapper().createObjectNode(); if (errorEventDefinition.getErrorCode() != null) errorEventDefinitionJSON.put("errorCode", errorEventDefinition.getErrorCode()); else errorEventDefinitionJSON.putNull("errorCode"); errorEventDefinition.getHandlerActivityId());
public int compare(ErrorEventDefinition o1, ErrorEventDefinition o2) { return o2.getPrecedence().compareTo(o1.getPrecedence()); } };
JSONObject errorEventDefinitionJSON = new JSONObject(); if (errorEventDefinition.getErrorCode() != null) errorEventDefinitionJSON.put("errorCode", errorEventDefinition.getErrorCode()); else errorEventDefinitionJSON.put("errorCode",null); errorEventDefinition.getHandlerActivityId());
public int compare(ErrorEventDefinition o1, ErrorEventDefinition o2) { return o2.getPrecedence().compareTo(o1.getPrecedence()); } };