void IOperationFlowEngine.FirstOperation(Guid tenantId, WorkFlowProcessProperties properties) { var entityId = iMetadataManager.GetEntityContextByEntityName(properties.EntityName); var workFlow = _managerWorkFlow.GetWorkFlow(tenantId, entityId, properties.SubTypeCode); if (workFlow != null) { var steps = _managerWorkFlowStep.GetWorkFlowSteps(tenantId, workFlow.WorkFlowId).ToList(); if (steps.Count > 0) { transactionHistory.CreateTransitionHistory(tenantId, new WorkFlowTransition { TransitionHistoryId = Guid.NewGuid(), RefId = properties.resultId, EntityId = entityId, WorkFlowStepId = steps[0].WorkFlowStepId, StartTime = DateTime.UtcNow, EndTime = DateTime.UtcNow, AssignedUserId = Guid.Empty, AuditInfo = new Entities.Common.AuditDetail { CreatedBy = properties.UserId } }); dynamic jsonObject = new JObject(); jsonObject.CurrentWorkFlowStep = steps[0].TransitionType.Id; IEntityResourceManager _iEntityResourceManager = new VPC.Framework.Business.EntityResourceManager.Contracts.EntityResourceManager(); _iEntityResourceManager.UpdateSpecificField(tenantId, properties.EntityName, properties.resultId, "CurrentWorkFlowStep", steps[0].TransitionType.Id.ToString()); // var resultId = _iEntityResourceManager.UpdateResult (tenantId, properties.UserId,properties.resultId,properties.EntityName, jsonObject, properties.SubTypeCode); } } }
private List <WorkFlowProcessInfo> WorkFlowCommon(Guid tenantId, string entityName, string subTypeName, Guid innerStepId) { var entityId = iMetadataManager.GetEntityContextByEntityName(entityName); var subTypeCode = iMetadataManager.GetSubTypeId(entityName, subTypeName); var workFlow = _managerWorkFlow.GetWorkFlow(tenantId, entityId, subTypeCode); if (workFlow == null) { return(new List <WorkFlowProcessInfo>()); } //get its all pre/post/process var allProcess = _managerWorkFlowProcess.GetWorkFlowProcess(tenantId, workFlow.WorkFlowId); var itsOperationProcess = (from workFlowPro in allProcess where workFlowPro.OperationOrTransactionId == innerStepId select workFlowPro).ToList(); return(itsOperationProcess); }