@Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj.getClass().equals(this.getClass()))) { return false; } final ProcessDefinitionImpl other = (ProcessDefinitionImpl)obj; return other.getUUID().equals(this.uuid); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj.getClass().equals(this.getClass()))) { return false; } ProcessDefinitionImpl other = (ProcessDefinitionImpl)obj; return other.getUUID().equals(uuid); }
@Override public String toString() { String st = this.getClass().getName() + "[uuid: " + getUUID() + ", name:" + getName() + ", description:" + getDescription() + ", version:" + getVersion(); st += "]"; return st; }
@Override public String toString() { String st = this.getClass().getName() + "[uuid: " + getUUID() + ", name:" + getName() + ", description:" + getDescription() + ", version:" + getVersion(); st += "]"; return st; }
public ProcessBuilder addSignalEventTask(final String eventName, final String signalCode, final boolean catchEvent) { Misc.checkArgsNotNull(eventName, signalCode); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name is an empty string.", Problem.SEVERITY_ERROR)); } if ("".equals(signalCode.trim())) { problems.add(new Problem("Signal 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.createSignalEventActivity(process.getUUID(), eventName, signalCode); activity.setCatchEvent(catchEvent); 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; }
public ProcessBuilder addSignalEventTask(final String eventName, final String signalCode, final boolean catchEvent) { Misc.checkArgsNotNull(eventName, signalCode); if ("".equals(eventName.trim())) { problems.add(new Problem("Event name is an empty string.", Problem.SEVERITY_ERROR)); } if ("".equals(signalCode.trim())) { problems.add(new Problem("Signal 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.createSignalEventActivity(process.getUUID(), eventName, signalCode); activity.setCatchEvent(catchEvent); 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; }
/** * Adds a group. * * @param groupName * the group name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addGroup(final String groupName) { Misc.checkArgsNotNull(groupName); if ("".equals(groupName.trim())) { problems.add(new Problem("Group name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ParticipantDefinitionImpl group = new ParticipantDefinitionImpl(process.getUUID(), groupName); process.addGroup(group); push(group); } else { problems.add(new Problem("Unable to add group " + groupName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a human to a process. * * @param humanName * the human name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addHuman(final String humanName) { Misc.checkArgsNotNull(humanName); if ("".equals(humanName.trim())) { problems.add(new Problem("Human name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ParticipantDefinitionImpl group = new ParticipantDefinitionImpl(process.getUUID(), humanName); process.addGroup(group); push(group); } else { problems.add(new Problem("Unable to add human " + humanName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a send event task. * * @param taskName * the task name. * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addSendEventTask(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.createSendEventActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add send event task " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a human to a process. * * @param humanName * the human name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addHuman(final String humanName) { Misc.checkArgsNotNull(humanName); if ("".equals(humanName.trim())) { problems.add(new Problem("Human name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ParticipantDefinitionImpl group = new ParticipantDefinitionImpl(process.getUUID(), humanName); process.addGroup(group); push(group); } else { problems.add(new Problem("Unable to add human " + humanName + " 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; }
/** * 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 group. * * @param groupName * the group name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addGroup(final String groupName) { Misc.checkArgsNotNull(groupName); if ("".equals(groupName.trim())) { problems.add(new Problem("Group name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ParticipantDefinitionImpl group = new ParticipantDefinitionImpl(process.getUUID(), groupName); process.addGroup(group); push(group); } else { problems.add(new Problem("Unable to add group " + groupName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a send event task. * * @param taskName * the task name. * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addSendEventTask(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.createSendEventActivity(process.getUUID(), taskName); process.addActivity(activity); push(activity); } else { problems.add(new Problem("Unable to add send event task " + taskName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
@Override public String toString() { String st = this.getClass().getName() + "[uuid: " + getUUID() + ", packageDefinitionUUID: " + getPackageDefinitionUUID() + ", processDefinitionUUID: " + getProcessDefinitionUUID() + ", processId:" + getProcessId() + ", accessLevel:" + getAccessLevel() + ", author:" + getAuthor() + ", codepage:" + getCodepage() + ", countrykey:" + getCountrykey() + ", created:" + getCreated() + ", description:" + getDescription() + ", durationUnit:" + getDurationUnit() + ", formalParameters:" + getFormalParameters() + ", limit:" + getLimit() + ", priority:" + getPriority() + ", publicationStatus:" + getPublicationStatus() + ", responsibles:" + getResponsibles() + ", timeEstimation:" + getTimeEstimation() + ", validFrom:" + getValidFrom() + ", validTo:" + getValidTo() + ", version:" + getVersion(); st += "]"; return st; }
/** * 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; }
/** * Adds an attachment on a process. * * @param name * the attachment name * @param filePath * the attachment file path * @param fileName * the attachment file name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addAttachment(final String name, final String filePath, final String fileName) { Misc.checkArgsNotNull(name); if ("".equals(name.trim())) { problems.add(new Problem("Attachment name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final AttachmentDefinitionImpl attachment = new AttachmentDefinitionImpl(process.getUUID(), name); attachment.setFilePath(filePath); attachment.setFileName(fileName); process.addAttachment(attachment); push(attachment); } return this; }
/** * Adds an attachment on a process. * * @param name * the attachment name * @param filePath * the attachment file path * @param fileName * the attachment file name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addAttachment(final String name, final String filePath, final String fileName) { Misc.checkArgsNotNull(name); if ("".equals(name.trim())) { problems.add(new Problem("Attachment name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final AttachmentDefinitionImpl attachment = new AttachmentDefinitionImpl(process.getUUID(), name); attachment.setFilePath(filePath); attachment.setFileName(fileName); process.addAttachment(attachment); push(attachment); } return this; }