Beispiel #1
0
        public override AbstractProcessInstanceModificationCommand toObject(JsonObject json)
        {
            AbstractProcessInstanceModificationCommand cmd = null;

            if (json.has(START_BEFORE))
            {
                cmd = new ActivityBeforeInstantiationCmd(JsonUtil.getString(json, START_BEFORE));
            }
            else if (json.has(START_AFTER))
            {
                cmd = new ActivityAfterInstantiationCmd(JsonUtil.getString(json, START_AFTER));
            }
            else if (json.has(START_TRANSITION))
            {
                cmd = new TransitionInstantiationCmd(JsonUtil.getString(json, START_TRANSITION));
            }
            else if (json.has(CANCEL_ALL))
            {
                cmd = new ActivityCancellationCmd(JsonUtil.getString(json, CANCEL_ALL));
                bool cancelCurrentActiveActivityInstances = JsonUtil.getBoolean(json, CANCEL_CURRENT);
                ((ActivityCancellationCmd)cmd).CancelCurrentActiveActivityInstances = cancelCurrentActiveActivityInstances;
            }
            else if (json.has(CANCEL_ACTIVITY_INSTANCES))
            {
                cmd = new ActivityInstanceCancellationCmd(JsonUtil.getString(json, PROCESS_INSTANCE), JsonUtil.getString(json, CANCEL_ACTIVITY_INSTANCES));
            }
            else if (json.has(CANCEL_TRANSITION_INSTANCES))
            {
                cmd = new TransitionInstanceCancellationCmd(JsonUtil.getString(json, PROCESS_INSTANCE), JsonUtil.getString(json, CANCEL_TRANSITION_INSTANCES));
            }

            return(cmd);
        }
Beispiel #2
0
            public static JobDefinitionSuspensionStateConfiguration fromJson(JsonObject jsonObject)
            {
                JobDefinitionSuspensionStateConfiguration config = new JobDefinitionSuspensionStateConfiguration();

                config.by = JsonUtil.getString(jsonObject, JOB_HANDLER_CFG_BY);
                if (jsonObject.has(JOB_HANDLER_CFG_JOB_DEFINITION_ID))
                {
                    config.jobDefinitionId = JsonUtil.getString(jsonObject, JOB_HANDLER_CFG_JOB_DEFINITION_ID);
                }
                if (jsonObject.has(JOB_HANDLER_CFG_PROCESS_DEFINITION_ID))
                {
                    config.processDefinitionId = JsonUtil.getString(jsonObject, JOB_HANDLER_CFG_PROCESS_DEFINITION_ID);
                }
                if (jsonObject.has(JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY))
                {
                    config.processDefinitionKey = JsonUtil.getString(jsonObject, JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY);
                }
                if (jsonObject.has(JOB_HANDLER_CFG_PROCESS_DEFINITION_TENANT_ID))
                {
                    config.isTenantIdSet = true;
                    if (!JsonUtil.isNull(jsonObject, JOB_HANDLER_CFG_PROCESS_DEFINITION_TENANT_ID))
                    {
                        config.tenantId = JsonUtil.getString(jsonObject, JOB_HANDLER_CFG_PROCESS_DEFINITION_TENANT_ID);
                    }
                }
                if (jsonObject.has(JOB_HANDLER_CFG_INCLUDE_JOBS))
                {
                    config.includeJobs = JsonUtil.getBoolean(jsonObject, JOB_HANDLER_CFG_INCLUDE_JOBS);
                }

                return(config);
            }
Beispiel #3
0
        public override TaskQueryVariableValue toObject(JsonObject json)
        {
            string        name              = JsonUtil.getString(json, "name");
            object        value             = JsonUtil.getRawObject(json, "value");
            QueryOperator @operator         = Enum.Parse(typeof(QueryOperator), JsonUtil.getString(json, "operator"));
            bool          isTaskVariable    = JsonUtil.getBoolean(json, "taskVariable");
            bool          isProcessVariable = JsonUtil.getBoolean(json, "processVariable");

            return(new TaskQueryVariableValue(name, value, @operator, isTaskVariable, isProcessVariable));
        }
Beispiel #4
0
 public override MigrationInstruction toObject(JsonObject json)
 {
     return(new MigrationInstructionImpl(readSourceActivityId(json), readTargetActivityId(json), JsonUtil.getBoolean(json, UPDATE_EVENT_TRIGGER)));
 }