예제 #1
0
        public virtual bool  Execute(ICommandContext commandContext)
        {
            if (executionId is null)
            {
                throw new ActivitiIllegalArgumentException("executionId is null");
            }
            if (variableName is null)
            {
                throw new ActivitiIllegalArgumentException("variableName is null");
            }

            IExecutionEntity execution = commandContext.ExecutionEntityManager.FindById <IExecutionEntity>(executionId);

            if (execution == null)
            {
                throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", typeof(IExecution));
            }

            bool hasVariable;

            if (isLocal)
            {
                hasVariable = execution.HasVariableLocal(variableName);
            }
            else
            {
                hasVariable = execution.HasVariable(variableName);
            }

            return(hasVariable);
        }