String instanceId = arg0.getParameter("instanceId");
String defVerId = arg0.getParameter("defVerId");
String defId = arg0.getParameter("defId");
MakeProcessDefinitionToJSON mkProcessDefinitionToJSON = null;
MakeProcessInstanceToJSON mkProcessInstanceToJSON = null;
String result = null;
ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
ProcessManagerRemote pm = null;
try {
pm = processManagerFactory.getProcessManagerForReadOnly();
if (instanceId != null) {
mkProcessInstanceToJSON = new MakeProcessInstanceToJSON(pm.getProcessInstance(instanceId));
mkProcessInstanceToJSON.setOnlyHumanActivity(onlyHumanActivity);
mkProcessInstanceToJSON.setPm(pm);
result = mkProcessInstanceToJSON.toJSON(pm.getProcessDefinitionWithInstanceId(instanceId));
} else {
mkProcessDefinitionToJSON = new MakeProcessDefinitionToJSON();
mkProcessDefinitionToJSON.setOnlyHumanActivity(onlyHumanActivity);
if (defVerId != null) {
result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(defVerId));