public static void ready(final Execution internalExecution) throws TaskNotFoundException { final ActivityInstanceUUID taskUUID = new ActivityInstanceUUID(internalExecution.getActivityInstanceUUID() .toString()); final InternalActivityDefinition activityDef = internalExecution.getNode(); final TaskInstance task = getTask(taskUUID); final String activityName = task.getActivityName(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Ready task : " + taskUUID + " on activity " + activityName); } // get performer (aka participant/swimlane) final Set<Performer> performers = getPerformers(activityDef); String userId = null; Set<String> candidates = null; if (performers != null) { candidates = getCandidates(performers, task); final Performer performer = performers.iterator().next(); if (performer.getFilterDefinition() != null) { candidates = executeFilter(task, candidates, performer); if (candidates.size() == 1) { userId = candidates.iterator().next(); } } } if (userId != null) { EnvTool.getRecorder().recordTaskReady(taskUUID, null, userId); } else { EnvTool.getRecorder().recordTaskReady(taskUUID, candidates, null); } ConnectorExecutor.executeConnectors(activityDef, internalExecution, HookDefinition.Event.taskOnReady); }
public void ready() { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Ready task : " + taskUUID + " on activity " + activityId); } this.state = TaskState.READY; // get performer (aka participant/swimlane) Performer performer = activityDef.getPerformer(); Set<String> ar = new HashSet<String>(); //if human set userId and candidates if (performer.getParticipantType().equals(ParticipantType.HUMAN)) { this.userId = performer.getParticipantId(); ar.add(performer.getParticipantId()); this.candidates = ar; } //Only ROLE and ORGANIZATIONAL_UNIT can have Role mapper (ParticipantBinding) if (performer.getRoleMapper() != null) { mapRole(performer); } else { // no role mapper: set an empty candidates list this.candidates = ar; } // performer assignment associated to this task assign(performer); EnvTool.getRecorder().recordTaskReady(this); HookExecutor.executeHooks(activityDef.getJavaHooks(), xpdlExecution, activityId, JavaHook.Type.taskOnReady); }
EngineEnvTool.getRecorder().recordTaskReady( new TaskCurrentInfo( this.getUUID(),