@Override public DispatchJobEvent popOwningProcess() throws ProcessIdentifierException { return new DispatchJobEvent(popOwner(), index, context, dataMap, activities); }
@Override public DispatchJobEvent pushOwningProcess(String localProcessName) throws ProcessIdentifierException { return new DispatchJobEvent(pushOwner(localProcessName), index, context, dataMap, activities); }
@Override public boolean handleError() { currentActivityIndex++; if (currentActivityIndex == jobEvent.getActivities().size()) return false; List<Activity<?>> newActivityList = new ArrayList<>(); newActivityList.add(jobEvent.getActivities().get( currentActivityIndex)); getBelow().receiveJob( new DispatchJobEvent(jobEvent.getOwningProcess(), jobEvent .getIndex(), jobEvent.getContext(), jobEvent .getData(), newActivityList)); return true; } }
private DispatchJobEvent prepareNewJobEvent( Map<String, T2Reference> data, AbstractDispatchEvent dispatchEvent) { DispatchJobEvent dispatchJobEvent = (DispatchJobEvent) dispatchEvent; Map<String, T2Reference> newInputs = new HashMap<String, T2Reference>( dispatchJobEvent.getData()); newInputs.putAll(data); DispatchJobEvent newJobEvent = new DispatchJobEvent(dispatchEvent .getOwningProcess(), dispatchEvent.getIndex(), dispatchEvent.getContext(), newInputs, ((DispatchJobEvent) dispatchEvent).getActivities()); /* * TODO: Should this be registered as an incomingJobs? If so the * conditional could even feed to itself, and we should also keep a * list of originalJobs. */ return newJobEvent; }
/** * Receive a job from the layer above, store it in the state map then relay * it to the layer below with a modified activity list containing only the * activity at index 0 */ @Override public void receiveJob(DispatchJobEvent jobEvent) { addJobToStateList(jobEvent); List<Activity<?>> newActivityList = new ArrayList<>(); newActivityList.add(jobEvent.getActivities().get(0)); getBelow().receiveJob( new DispatchJobEvent(jobEvent.getOwningProcess(), jobEvent .getIndex(), jobEvent.getContext(), jobEvent.getData(), newActivityList)); }
DispatchJobEvent dispatchJobEvent = new DispatchJobEvent(e .getOwningProcess(), e .getIndex(), e.getContext(),