Exemplo n.º 1
0
        public void Rollback(ApiCommandArgument arg)
        {
            AuthenticationService.Authenticate(arg.SecurityToken);

            if (!AuthenticationService.IsAuthenticated())
            {
                return;
            }

            if (!AuthorizationService.IsAllowedToExecuteCommand(arg.InstanceId, WorkflowCommandType.Rollback))
            {
                return;
            }

            FireCommandWithWaiting(arg, delegate(ApiCommandArgument arg1)
            {
                using (var sync = GetWorkflowSync(arg1))
                {
                    WorkflowInitService.RaiseRollback(arg1.InstanceId, arg1.Comment);
                    sync.WaitHandle.WaitOne(4000);
                }
            });
        }