コード例 #1
0
        public ActionResult GetProcessJson(string keyValue, string nodeId)
        {
            WFProcessInstanceEntity processEntity       = wfProcessBll.GetProcessEntity(keyValue);
            WFProcessSchemeEntity   processSchemeEntity = wfProcessBll.GetProcessSchemeEntity(processEntity.F_ProcessSchemeId);
            var         nodeList  = wfProcessBll.GetProcessNodeList(keyValue);
            IWfRuntime  wfRuntime = new WfRuntime(processSchemeEntity.F_SchemeContent);
            WFNodeModel node      = wfRuntime.getCurrentNode(nodeId);

            Dictionary <string, FormModuleEntity> formDataLsit = new Dictionary <string, FormModuleEntity>();

            foreach (var item in node.setInfo.formHaven)
            {
                FormModuleEntity formNewEntity = formModuleBLL.GetEntity(item);
                formDataLsit.Add(item, formNewEntity);
            }
            List <FormModuleEntity> formEntityList = new List <FormModuleEntity>();
            Dictionary <string, FormModuleInstanceEntity> dFormData = new Dictionary <string, FormModuleInstanceEntity>();
            var formdata = formModuleBLL.GetInstanceList(keyValue);

            foreach (var item in formdata)
            {
                Form_ModuleContentEntity formEntity = formModuleBLL.GetFormContentEntity(item.F_FrmContentId);
                if (formDataLsit.ContainsKey(formEntity.F_FrmId) && !dFormData.ContainsKey(formEntity.F_FrmId))
                {
                    formDataLsit[formEntity.F_FrmId].F_FrmContent = formEntity.F_FrmContent;
                    formEntityList.Add(formDataLsit[formEntity.F_FrmId]);
                    dFormData.Add(formEntity.F_FrmId, item);
                }
            }
            var dataJson = new
            {
                processEntity       = processEntity,
                processSchemeEntity = processSchemeEntity,
                nodeList            = nodeList,
                formEntityList      = formEntityList,
                dFormData           = dFormData,
                currentNode         = node
            };

            return(Content(dataJson.ToJson()));
        }