Beispiel #1
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 #2
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);
        }