示例#1
0
        public object RunWorkflow(
            JsWorkflowIdentity workflowIdentity,
            JsWorkflowInstanceIdentity workflowInstanceIdentity,
            JObject inArguments,
            string actionCode,
            JObject parameters)
        {
            var inputs = new Dictionary <string, object>();

            if (inArguments != null)
            {
                foreach (var a in inArguments)
                {
                    //TODO: понять как быть с типизацией (пока делаю только string)
                    inputs.Add(a.Key, a.Value.Value <string>());
                }
            }

            var request = new JsWfRequest
            {
                WorkflowIdentity         = workflowIdentity,
                WorkflowInstanceIdentity = workflowInstanceIdentity,
                Action    = actionCode,
                ChangeSet = parameters
            };

            return(_service.Execute(request, inputs));
        }
示例#2
0
        public object ExecuteWorkflow(
            JsWorkflowIdentity workflowIdentity,
            JsWorkflowInstanceIdentity workflowInstanceIdentity,
            EntityId entityId,
            string actionCode,
            JObject parameters)
        {
            var inputs = entityId == null
                ? new Dictionary <string, object>()
                : new Dictionary <string, object> {
                { "EntityId", entityId.Id }
            };

            var request = new JsWfRequest
            {
                WorkflowIdentity         = workflowIdentity,
                WorkflowInstanceIdentity = workflowInstanceIdentity,
                Action    = actionCode,
                ChangeSet = parameters
            };

            return(_service.Execute(request, inputs));
        }