public IActionResult Post([FromRoute] WorkFlowInstanceCancleModel model)
        {
            var flowInstance = _workFlowInstanceService.FindById(model.Id);

            if (flowInstance == null)
            {
                return(NotFound());
            }
            WorkFlowCancellationContext context = new WorkFlowCancellationContext
            {
                EntityMetaData = _entityFinder.FindById(flowInstance.EntityId)
                ,
                ObjectId = flowInstance.ObjectId
            };
            var result = _workFlowCanceller.Cancel(context);

            if (result.IsSuccess)
            {
                return(JOk(T["operation_success"]));
            }
            return(JError(result.Message));
        }
Beispiel #2
0
        public IActionResult Post(Guid entityid, Guid recordid)
        {
            WorkFlowCancellationContext context = new WorkFlowCancellationContext
            {
                EntityMetaData = _entityFinder.FindById(entityid)
                ,
                ObjectId = recordid
            };
            var result = _workFlowCanceller.Cancel(context);

            if (result.IsSuccess)
            {
                return(JOk(T["operation_success"]));
            }
            return(JError(result.Message));
        }
Beispiel #3
0
        public IActionResult Cancel(Guid id)
        {
            var instance = _workFlowInstanceService.FindById(id);

            if (instance != null)
            {
                WorkFlowCancellationContext context = new WorkFlowCancellationContext
                {
                    EntityMetaData = _entityFinder.FindById(instance.EntityId)
                    ,
                    ObjectId = instance.ObjectId
                };
                var flag = _workFlowCanceller.Cancel(context);
                if (flag.IsSuccess)
                {
                    return(JOk(T["operation_success"]));
                }
                else
                {
                    return(JError(flag.Message));
                }
            }
            return(JError(T["operation_error"]));
        }