/** * Adds a system task. By default The join type is XOR and the split types is * AND. * * @param taskName * the system task name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addSystemTask(final String taskName) { Misc.checkArgsNotNull(taskName); if ("".equals(taskName.trim())) { problems.add(new Problem("Task name 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.createAutomaticActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add system task " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Add a decision node to the ProcessBuilder. By default The join type is XOR * and the split types is AND. * * @param taskName * the decision node name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addDecisionNode(final String taskName) { Misc.checkArgsNotNull(taskName); if ("".equals(taskName.trim())) { problems.add(new Problem("Task name 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.createAutomaticActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add decision node " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a system task. By default The join type is XOR and the split types is * AND. * * @param taskName * the system task name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addSystemTask(final String taskName) { Misc.checkArgsNotNull(taskName); if ("".equals(taskName.trim())) { problems.add(new Problem("Task name 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.createAutomaticActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add system task " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Add a decision node to the ProcessBuilder. By default The join type is XOR * and the split types is AND. * * @param taskName * the decision node name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addDecisionNode(final String taskName) { Misc.checkArgsNotNull(taskName); if ("".equals(taskName.trim())) { problems.add(new Problem("Task name 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.createAutomaticActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add decision node " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a terminate end event. This event ends the process execution even if * other branches are active. * * @param eventName * the event name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addTerminateEndEvent(final String eventName) { Misc.checkArgsNotNull(eventName); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name 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.createAutomaticActivity(process.getUUID(), eventName); activity.setTerminateProcess(true); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add terminate end event " + eventName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a terminate end event. This event ends the process execution even if * other branches are active. * * @param eventName * the event name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addTerminateEndEvent(final String eventName) { Misc.checkArgsNotNull(eventName); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name 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.createAutomaticActivity(process.getUUID(), eventName); activity.setTerminateProcess(true); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add terminate end event " + eventName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }