Esempio n. 1
0
        public string Process(WorkflowContext workflowContext)
        {
            var workflow     = WorkflowBuilder.BuilWorkflow(workflowContext.WorkflowType);
            var workflowData = (!string.IsNullOrEmpty(workflowContext.DataKey)) ?
                               Serializer.DeserializeData(GetDataKey(workflowContext.WorkflowType, workflowContext.DataKey)):
                               new DataStorage();

            if (workflowData != null)
            {
                workflow.Data = (DataStorage)workflowData;
                workflow.Id   = workflowData["id"];
            }
            else
            {
                workflow.Id = workflowContext.WorkflowId;
            }

            var result = workflow.Execute(workflowContext.WorkflowStep, workflowContext.Parameters);

            if (!string.IsNullOrEmpty(workflowContext.DataKey))
            {
                Serializer.SerializeData(GetDataKey(workflowContext.WorkflowType, workflowContext.DataKey), workflow.Data);
            }
            return(result);
        }