Exemple #1
0
        protected internal virtual UpdateProcessInstanceSuspensionStateBuilder createUpdateSuspensionStateBuilder(ProcessEngine engine)
        {
            UpdateProcessInstanceSuspensionStateSelectBuilder selectBuilder = engine.RuntimeService.updateProcessInstanceSuspensionState();

            if (!string.ReferenceEquals(processInstanceId, null))
            {
                return(selectBuilder.byProcessInstanceId(processInstanceId));
            }
            else if (!string.ReferenceEquals(processDefinitionId, null))
            {
                return(selectBuilder.byProcessDefinitionId(processDefinitionId));
            }
            else
            {     //processDefinitionKey != null
                UpdateProcessInstanceSuspensionStateTenantBuilder tenantBuilder = selectBuilder.byProcessDefinitionKey(processDefinitionKey);

                if (!string.ReferenceEquals(processDefinitionTenantId, null))
                {
                    tenantBuilder.processDefinitionTenantId(processDefinitionTenantId);
                }
                else if (processDefinitionWithoutTenantId)
                {
                    tenantBuilder.processDefinitionWithoutTenantId();
                }

                return(tenantBuilder);
            }
        }
Exemple #2
0
        protected internal virtual UpdateProcessInstancesSuspensionStateBuilder createUpdateSuspensionStateGroupBuilder(ProcessEngine engine)
        {
            UpdateProcessInstanceSuspensionStateSelectBuilder selectBuilder = engine.RuntimeService.updateProcessInstanceSuspensionState();
            UpdateProcessInstancesSuspensionStateBuilder      groupBuilder  = null;

            if (processInstanceIds != null)
            {
                groupBuilder = selectBuilder.byProcessInstanceIds(processInstanceIds);
            }

            if (processInstanceQuery != null)
            {
                if (groupBuilder == null)
                {
                    groupBuilder = selectBuilder.byProcessInstanceQuery(processInstanceQuery.toQuery(engine));
                }
                else
                {
                    groupBuilder.byProcessInstanceQuery(processInstanceQuery.toQuery(engine));
                }
            }

            if (historicProcessInstanceQuery != null)
            {
                if (groupBuilder == null)
                {
                    groupBuilder = selectBuilder.byHistoricProcessInstanceQuery(historicProcessInstanceQuery.toQuery(engine));
                }
                else
                {
                    groupBuilder.byHistoricProcessInstanceQuery(historicProcessInstanceQuery.toQuery(engine));
                }
            }

            return(groupBuilder);
        }