@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; }
private Set<ProcessDefinition> getProcessCopy(final Set<ProcessDefinition> src) { final Set<ProcessDefinition> result = new HashSet<ProcessDefinition>(); if (src != null) { for (final ProcessDefinition p : src) { result.add(new ProcessDefinitionImpl(p)); } } return result; }
@Override public String toString() { String st = this.getClass().getName() + "[uuid: " + getUUID() + ", name:" + getName() + ", description:" + getDescription() + ", version:" + getVersion(); st += "]"; return st; }
/** * 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; }
/** * 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 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; }
if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ActivityDefinition fromActivity = process.getActivity(fromActivityName); BoundaryEvent event = null; if (fromActivity != null && boundaryEventName != null) { event = fromActivity.getBoundaryEvent(boundaryEventName); final ActivityDefinition toActivity = process.getActivity(toActivityName); if (fromActivity == null) { problems.add(new Problem("Unable to add transition from " + fromActivityName + " to " + toActivityName Problem.SEVERITY_ERROR)); } else { final TransitionDefinitionImpl transition = new TransitionDefinitionImpl(process.getUUID(), transitionName, fromActivityName, toActivityName); ((ActivityDefinitionImpl) toActivity).addIncomingTransition(transition);
@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); }
((ProcessDefinitionImpl) process).addIterationDescriptors(iterationDescriptor); for (final String activityName : iterationDescriptor.getCycleNodes()) { final ActivityDefinitionImpl activity = (ActivityDefinitionImpl) process.getActivity(activityName); Thread.currentThread().setContextClassLoader(current); return new ProcessDefinitionImpl(internalProcess); } catch (final RuntimeException re) { EnvTool.getClassDataLoader().removeProcessClassLoader(processUUID);
public ProcessBuilder addEventSubProcess(final String processName, final String version) { if ("".equals(processName.trim())) { problems.add(new Problem("Event sub-process name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final EventProcessDefinitionImpl event = new EventProcessDefinitionImpl(processName, version); process.addEventSubProcess(event); push(event); } else { problems.add(new Problem("Unable to add an event sub process " + processName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a category defining the process * * @param category * the category name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addCategory(final String category) { Misc.checkArgsNotNull(category); if ("".equals(category.trim())) { problems.add(new Problem("Category name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; process.addCategory(category); } else { problems.add(new Problem("Unable to add category " + category + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a {@link RoleResolver} to a group. * * @param groupResolverClassName * the {@link RoleResolver} class name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addGroupResolver(final String groupResolverClassName) { Misc.checkArgsNotNull(groupResolverClassName); if ("".equals(groupResolverClassName.trim())) { problems.add(new Problem("Resolver class name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ParticipantDefinitionImpl.class); if (isParticipant(obj)) { final ParticipantDefinitionImpl group = (ParticipantDefinitionImpl) obj; final RoleMapperDefinition resolver = new ConnectorDefinitionImpl(groupResolverClassName); group.setResolver(resolver); final ProcessDefinitionImpl process = getProcess(); process.addGroup(group); push(group); push(resolver); } else { problems.add(new Problem("Unable to add resolver " + groupResolverClassName + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
connector.setEvent(event); connector.setThrowingException(throwingException); process.addConnector(connector); push(connector); } else {
/** * 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; }
@Override public String toString() { String st = this.getClass().getName() + "[uuid: " + getUUID() + ", name:" + getName() + ", description:" + getDescription() + ", version:" + getVersion(); st += "]"; return st; }
/** * 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 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; }
if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; final ActivityDefinition fromActivity = process.getActivity(fromActivityName); BoundaryEvent event = null; if (fromActivity != null && boundaryEventName != null) { event = fromActivity.getBoundaryEvent(boundaryEventName); final ActivityDefinition toActivity = process.getActivity(toActivityName); if (fromActivity == null) { problems.add(new Problem("Unable to add transition from " + fromActivityName + " to " + toActivityName Problem.SEVERITY_ERROR)); } else { final TransitionDefinitionImpl transition = new TransitionDefinitionImpl(process.getUUID(), transitionName, fromActivityName, toActivityName); ((ActivityDefinitionImpl) toActivity).addIncomingTransition(transition);