/** * Add a end error event task. * * @param eventName * the name of event. * @param errorCode * the error code of the event. * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addErrorEventTask(final String eventName, final String errorCode) { Misc.checkArgsNotNull(eventName, errorCode); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name is an empty string.", Problem.SEVERITY_ERROR)); } if ("".equals(errorCode.trim())) { problems.add(new Problem("Error code is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ActivityDefinitionImpl activity = ActivityDefinitionImpl.createErrorEventActivity(process.getUUID(), eventName, errorCode); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add an error event task " + eventName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Add a end error event task. * * @param eventName * the name of event. * @param errorCode * the error code of the event. * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addErrorEventTask(final String eventName, final String errorCode) { Misc.checkArgsNotNull(eventName, errorCode); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name is an empty string.", Problem.SEVERITY_ERROR)); } if ("".equals(errorCode.trim())) { problems.add(new Problem("Error code is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ActivityDefinitionImpl activity = ActivityDefinitionImpl.createErrorEventActivity(process.getUUID(), eventName, errorCode); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add an error event task " + eventName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }