use of org.activiti.engine.impl.util.json.JSONObject in project Activiti by Activiti.
the class TimerChangeProcessDefinitionSuspensionStateJobHandler method createJobHandlerConfiguration.
public static String createJobHandlerConfiguration(boolean includeProcessInstances) {
JSONObject json = new JSONObject();
json.put(JOB_HANDLER_CFG_INCLUDE_PROCESS_INSTANCES, includeProcessInstances);
return json.toString();
}
use of org.activiti.engine.impl.util.json.JSONObject in project Activiti by Activiti.
the class TimerSuspendProcessDefinitionHandler method execute.
public void execute(JobEntity job, String configuration, ExecutionEntity execution, CommandContext commandContext) {
JSONObject cfgJson = new JSONObject(configuration);
String processDefinitionId = job.getProcessDefinitionId();
boolean suspendProcessInstances = getIncludeProcessInstances(cfgJson);
SuspendProcessDefinitionCmd suspendProcessDefinitionCmd = new SuspendProcessDefinitionCmd(processDefinitionId, null, suspendProcessInstances, null, job.getTenantId());
suspendProcessDefinitionCmd.execute(commandContext);
}
use of org.activiti.engine.impl.util.json.JSONObject in project Activiti by Activiti.
the class JsonProcessDefinitionConverter method toJsonObject.
public JSONObject toJsonObject(ProcessDefinition processDefinition) {
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) processDefinition;
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", processDefinitionEntity.getId());
if (processDefinitionEntity.getKey() != null) {
jsonObject.put("key", processDefinitionEntity.getKey());
}
if (processDefinitionEntity.getDeploymentId() != null) {
jsonObject.put("deploymentId", processDefinitionEntity.getDeploymentId());
}
return jsonObject;
}
use of org.activiti.engine.impl.util.json.JSONObject in project Activiti by Activiti.
the class JsonProcessEngineInfoConverter method toJsonObject.
public JSONObject toJsonObject(ProcessEngineInfo processEngineInfo) {
ProcessEngineInfoImpl processEngineInfoImpl = (ProcessEngineInfoImpl) processEngineInfo;
JSONObject jsonObject = new JSONObject();
jsonObject.put("name", processEngineInfoImpl.getName());
jsonObject.put("resourceUrl", processEngineInfoImpl.getResourceUrl());
jsonObject.put("exception", processEngineInfoImpl.getException());
return jsonObject;
}
use of org.activiti.engine.impl.util.json.JSONObject in project Activiti by Activiti.
the class JsonTaskConverter method toJsonObject.
public JSONObject toJsonObject(Task task) {
TaskEntity taskEntity = (TaskEntity) task;
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", taskEntity.getId());
jsonObject.put("dbversion", taskEntity.getRevision());
jsonObject.put("assignee", taskEntity.getAssignee());
jsonObject.put("name", taskEntity.getName());
jsonObject.put("priority", taskEntity.getPriority());
jsonObject.put("createTime", taskEntity.getCreateTime());
if (taskEntity.getExecutionId() != null) {
jsonObject.put("activityInstance", taskEntity.getExecutionId());
}
if (taskEntity.getProcessDefinitionId() != null) {
jsonObject.put("processDefinition", taskEntity.getProcessDefinitionId());
}
return jsonObject;
}
Aggregations