writeJson(writer, jsonObject, callback);
}
@RequestMapping("/json/monitoring/activity/view/(*:activityId)")
public void activityView(Writer writer, @RequestParam(value = "callback", required = false) String callback, @RequestParam("activityId") String activityId) throws JSONException, IOException {
WorkflowActivity activity = workflowManager.getActivityById(activityId);
if (activity == null) {
return;
}
WorkflowActivity activityInfo = workflowManager.getRunningActivityInfo(activityId);
JSONObject jsonObject = new JSONObject();
jsonObject.accumulate("activityId", activity.getId());
jsonObject.accumulate("activityDefId", activity.getActivityDefId());
jsonObject.accumulate("processId", activity.getProcessId());
jsonObject.accumulate("processDefId", activity.getProcessDefId());
jsonObject.accumulate("processVersion", activity.getProcessVersion());
jsonObject.accumulate("processName", activity.getProcessName());
jsonObject.accumulate("activityName", activity.getName());
jsonObject.accumulate("description", activity.getDescription());
jsonObject.accumulate("participant", activityInfo.getPerformer());
jsonObject.accumulate("acceptedUser", activityInfo.getNameOfAcceptedUser());
String[] assignmentUsers = activityInfo.getAssignmentUsers();
for (String user : assignmentUsers) {
jsonObject.accumulate("assignee", user);
}
Collection<WorkflowVariable> variableList = workflowManager.getActivityVariableList(activityId);
for (WorkflowVariable variable : variableList) {