@Override public ActivityDefinition getActivity(final String name) { for (final ActivityDefinition activity : getActivities()) { if (activity.getName().equals(name)) { return activity; } } return null; }
@Override public ActivityDefinition getActivity(final String name) { for (final ActivityDefinition activity : getActivities()) { if (activity.getName().equals(name)) { return activity; } } return null; }
@Override public Set<TransitionDefinition> getTransitions() { if (activities == null) { return Collections.emptySet(); } final Set<TransitionDefinition> transitions = new HashSet<TransitionDefinition>(); for (final ActivityDefinition activity : getActivities()) { final Set<TransitionDefinition> activityTransitions = activity.getOutgoingTransitions(); for (final TransitionDefinition transition : activityTransitions) { transitions.add(transition); } } return transitions; }
@Override public Set<TransitionDefinition> getTransitions() { if (activities == null) { return Collections.emptySet(); } final Set<TransitionDefinition> transitions = new HashSet<TransitionDefinition>(); for (final ActivityDefinition activity : getActivities()) { final Set<TransitionDefinition> activityTransitions = activity.getOutgoingTransitions(); for (final TransitionDefinition transition : activityTransitions) { transitions.add(transition); } } return transitions; }
@Override public Map<String, ActivityDefinition> getFinalActivities() { final Map<String, ActivityDefinition> result = new HashMap<String, ActivityDefinition>(); for (final ActivityDefinition activity : getActivities()) { if (!activity.hasOutgoingTransitions()) { result.put(activity.getName(), activity); } } return result; }
@Override public Map<String, ActivityDefinition> getInitialActivities() { final Map<String, ActivityDefinition> result = new HashMap<String, ActivityDefinition>(); for (final ActivityDefinition activity : getActivities()) { if (!activity.hasIncomingTransitions()) { result.put(activity.getName(), activity); } } return result; }
@Override public Map<String, ActivityDefinition> getInitialActivities() { final Map<String, ActivityDefinition> result = new HashMap<String, ActivityDefinition>(); for (final ActivityDefinition activity : getActivities()) { if (!activity.hasIncomingTransitions()) { result.put(activity.getName(), activity); } } return result; }
@Override public Set<String> getProcessDependencies() { final Set<String> processDependencies = new HashSet<String>(); for (final ActivityDefinition activity : getActivities()) { if (activity.getSubflowProcessName() != null) { processDependencies.add(activity.getSubflowProcessName()); } } return processDependencies; }
@Override public Set<String> getProcessDependencies() { final Set<String> processDependencies = new HashSet<String>(); for (final ActivityDefinition activity : getActivities()) { if (activity.getSubflowProcessName() != null) { processDependencies.add(activity.getSubflowProcessName()); } } return processDependencies; }
@Override public Map<String, ActivityDefinition> getFinalActivities() { final Map<String, ActivityDefinition> result = new HashMap<String, ActivityDefinition>(); for (final ActivityDefinition activity : getActivities()) { if (!activity.hasOutgoingTransitions()) { result.put(activity.getName(), activity); } } return result; }
private void setSubProcesses(final ProcessDefinitionImpl process) { final Set<String> subProcesses = new HashSet<String>(); for (final ActivityDefinition activity : process.getActivities()) { if (activity.isSubflow()) { subProcesses.add(activity.getSubflowProcessName()); } } if (!subProcesses.isEmpty()) { process.setSubProcesses(subProcesses); } }
private void setSubProcesses(final ProcessDefinitionImpl process) { final Set<String> subProcesses = new HashSet<String>(); for (final ActivityDefinition activity : process.getActivities()) { if (activity.isSubflow()) { subProcesses.add(activity.getSubflowProcessName()); } } if (!subProcesses.isEmpty()) { process.setSubProcesses(subProcesses); } }
@Override public Set<String> getClassDependencies() { final Set<String> classDependencies = new HashSet<String>(); for (final ParticipantDefinition participant : getParticipants()) { if (participant.getRoleMapper() != null) { classDependencies.add(participant.getRoleMapper().getClassName()); } } for (final ConnectorDefinition connector : getConnectors()) { classDependencies.add(connector.getClassName()); } for (final ActivityDefinition activity : getActivities()) { classDependencies.addAll(activity.getClassDependencies()); } return classDependencies; }
private void checkExceptionsTransitions(final ProcessDefinitionImpl process) { for (final ActivityDefinition activity : process.getActivities()) { final List<BoundaryEvent> boundaryEvents = activity.getBoundaryEvents(); for (final BoundaryEvent boundaryEvent : boundaryEvents) { if (boundaryEvent.getTransition() == null) { problems.add(new Problem("The boundary event '" + boundaryEvent.getName() + "' on activity '" + activity.getName() + "' must have an exception transition", Problem.SEVERITY_ERROR)); } } } }
@Override public Set<String> getClassDependencies() { final Set<String> classDependencies = new HashSet<String>(); for (final ParticipantDefinition participant : getParticipants()) { if (participant.getRoleMapper() != null) { classDependencies.add(participant.getRoleMapper().getClassName()); } } for (final ConnectorDefinition connector : getConnectors()) { classDependencies.add(connector.getClassName()); } for (final ActivityDefinition activity : getActivities()) { classDependencies.addAll(activity.getClassDependencies()); } return classDependencies; }
private void checkExceptionsTransitions(final ProcessDefinitionImpl process) { for (final ActivityDefinition activity : process.getActivities()) { final List<BoundaryEvent> boundaryEvents = activity.getBoundaryEvents(); for (final BoundaryEvent boundaryEvent : boundaryEvents) { if (boundaryEvent.getTransition() == null) { problems.add(new Problem("The boundary event '" + boundaryEvent.getName() + "' on activity '" + activity.getName() + "' must have an exception transition", Problem.SEVERITY_ERROR)); } } } }
private void checkEventSubProcess(final ProcessDefinitionImpl process) { if (ProcessType.EVENT_SUB_PROCESS.equals(process.getType())) { for (final ActivityDefinition activity : process.getActivities()) { if (activity.getIncomingTransitions().size() == 0) { if (!(activity.isTimer() || activity.isCatchingSignalEvent() || activity.isReceiveEvent() || activity .isCatchingErrorEvent())) { problems.add(new Problem("Process " + process.getName() + " must not begin with a \"none\" start event", Problem.SEVERITY_ERROR)); } } } } }
private void checkEventSubProcess(final ProcessDefinitionImpl process) { if (ProcessType.EVENT_SUB_PROCESS.equals(process.getType())) { for (final ActivityDefinition activity : process.getActivities()) { if (activity.getIncomingTransitions().size() == 0) { if (!(activity.isTimer() || activity.isCatchingSignalEvent() || activity.isReceiveEvent() || activity .isCatchingErrorEvent())) { problems.add(new Problem("Process " + process.getName() + " must not begin with a \"none\" start event", Problem.SEVERITY_ERROR)); } } } } }
private void checkStartEvents(final ProcessDefinitionImpl process) { for (final ActivityDefinition activity : process.getActivities()) { if (activity.getIncomingTransitions().size() == 0) { if (activity.isThrowingSignalEvent()) { problems.add(new Problem("Process " + process.getName() + " cannot start with a throw signal event", Problem.SEVERITY_ERROR)); } else if (activity.isThrowingSignalEvent()) { problems.add(new Problem("Process " + process.getName() + " cannot start with a throw error event", Problem.SEVERITY_ERROR)); } else if (activity.isCatchingErrorEvent() && ProcessType.PROCESS.equals(process.getType())) { problems.add(new Problem("Process " + process.getName() + " cannot start with a catch error event because it is not an event sub-process.", Problem.SEVERITY_ERROR)); } } } }
private void checkStartEvents(final ProcessDefinitionImpl process) { for (final ActivityDefinition activity : process.getActivities()) { if (activity.getIncomingTransitions().size() == 0) { if (activity.isThrowingSignalEvent()) { problems.add(new Problem("Process " + process.getName() + " cannot start with a throw signal event", Problem.SEVERITY_ERROR)); } else if (activity.isThrowingSignalEvent()) { problems.add(new Problem("Process " + process.getName() + " cannot start with a throw error event", Problem.SEVERITY_ERROR)); } else if (activity.isCatchingErrorEvent() && ProcessType.PROCESS.equals(process.getType())) { problems.add(new Problem("Process " + process.getName() + " cannot start with a catch error event because it is not an event sub-process.", Problem.SEVERITY_ERROR)); } } } }