WfAssignment wfa = getSharkAssignment(sc, activityId);
if (wfa != null) {
WfActivity activity = wfa.activity();
WfResource assignee = wfa.assignee();
WfProcess process = activity.container();
WfProcessMgr manager = process.manager();
ass = new WorkflowAssignment();
ass.setAccepted(wfa.get_accepted_status());
ass.setActivityId(activity.key());
ass.setActivityName(activity.name());
ass.setAssigneeId(assignee.resource_key());
ass.setAssigneeName(assignee.resource_name());
ass.setDescription(activity.description());
ass.setPriority(new Short(activity.priority()).toString());
ass.setProcessId(process.key());
ass.setProcessName(process.name());
ass.setProcessVersion(manager.version());
ass.setProcessDefId(manager.name());
WorkflowActivity wfActivity = getRunningActivityInfo(activityId);
ass.setDateCreated(wfActivity.getCreatedTime());
ass.setDueDate(wfActivity.getDue());
ass.setAssigneeList(getAssignmentResourceIds(ass.getProcessDefId(), ass.getProcessId(), ass.getActivityId()));
if (WorkflowUtil.containsHashVariable(ass.getActivityName())) {
Collection<WorkflowVariable> variableList = JSPClientUtilities.getVariableData(sc, activity, false);
ass.setProcessVariableList((List<WorkflowVariable>) variableList);
//process activity name variable
ass.setActivityName(WorkflowUtil.processVariable(ass.getActivityName(), null, ass));
}
Shark shark = Shark.getInstance();
AdminMisc admin = shark.getAdminMisc();
WMSessionHandle sessionHandle = sc.getSessionHandle();
WMEntity ent = admin.getActivityDefinitionInfo(sessionHandle, process.key(), activity.key());
ass.setActivityDefId(ent.getId());
ass.setProcessRequesterId(getUserByProcessIdAndActivityDefId(ass.getProcessDefId(), ass.getProcessId(), WorkflowUtil.ACTIVITY_DEF_ID_RUN_PROCESS));
WfRequester requester = process.requester();
if (requester != null) {
boolean isSubflow = (requester instanceof WfActivity);
if (isSubflow) {
WfActivity act = (WfActivity) requester;
ass.setSubflow(true);
if (getWorkflowProcessLink(process.key()) == null) {
internalAddWorkflowProcessLink(act.container().key(), process.key());
}
}
}
// get participant