Пример #1
0
        public virtual void close(CaseExecutionTriggerDto triggerDto)
        {
            try
            {
                CaseService caseService = engine.CaseService;
                CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseInstanceId);

                initializeCommand(commandBuilder, triggerDto, "close");

                commandBuilder.close();
            }
            catch (NotFoundException e)
            {
                throw createInvalidRequestException("close", Status.NOT_FOUND, e);
            }
            catch (NotValidException e)
            {
                throw createInvalidRequestException("close", Status.BAD_REQUEST, e);
            }
            catch (NotAllowedException e)
            {
                throw createInvalidRequestException("close", Status.FORBIDDEN, e);
            }
            catch (ProcessEngineException e)
            {
                throw createRestException("close", Status.INTERNAL_SERVER_ERROR, e);
            }
        }
Пример #2
0
        protected internal virtual void initializeCommand(CaseExecutionCommandBuilder commandBuilder, CaseExecutionTriggerDto triggerDto, string transition)
        {
            IDictionary <string, TriggerVariableValueDto> variables = triggerDto.Variables;

            if (variables != null && variables.Count > 0)
            {
                initializeCommandWithVariables(commandBuilder, variables, transition);
            }

            IList <VariableNameDto> deletions = triggerDto.Deletions;

            if (deletions != null && deletions.Count > 0)
            {
                initializeCommandWithDeletions(commandBuilder, deletions, transition);
            }
        }