流程操作以及组织结构管理
作者:互联网
当流程结束时将数据填充到关联表单
protected override void OnWorkflowInstanceStateChanged(H3.Workflow.Instance.WorkflowInstanceState oldState, H3.Workflow.Instance.WorkflowInstanceState newState) { //流程审批结束事件(先执行业务规则,在执行该方法)。 if(oldState == H3.Workflow.Instance.WorkflowInstanceState.Running && newState == H3.Workflow.Instance.WorkflowInstanceState.Finished) { //执行业务代码逻辑 //输入表单,对目标表单数据进行填充,目标表单ID D0020337ce5e2cf888f49c6a99da0c8836f6a1f H3.DataModel.BizObject targetBiz = new H3.DataModel.BizObject(this.Engine, this.Engine.BizObjectManager.GetPublishedSchema("D0020337ce5e2cf888f49c6a99da0c8836f6a1f"), this.Request.UserContext.UserId); targetBiz["F0000001"] = this.Request.BizObject["F0000003"]; targetBiz["F0000002"] = this.Request.BizObject["F0000004"]; targetBiz.Status = H3.DataModel.BizObjectStatus.Effective; targetBiz.Create(); } //流程审批结束后,重新激活事件(先执行业务规则,在执行该方法)。 if(oldState == H3.Workflow.Instance.WorkflowInstanceState.Finished && newState == H3.Workflow.Instance.WorkflowInstanceState.Running) { //执行业务代码逻辑 } base.OnWorkflowInstanceStateChanged(oldState, newState); }
低于100不允许导入
//导入数据金额小于100删除 if(double.Parse("0" + this.Request.BizObject["F0000004"]) < 100) { this.Request.BizObject.Remove(); }
一个流程表单如果被编辑以后重新发起审批
if(actionName == "Submit" && this.Request.BizObject.Status == H3.DataModel.BizObjectStatus.Effective) { H3.Workflow.Messages.ActivateInstanceMessage activiteinstanceMessage = new H3.Workflow.Messages.ActivateInstanceMessage(this.Request.InstanceId); //传递参数为流程实例ID this.Request.Engine.WorkflowInstanceManager.SendMessage(activiteinstanceMessage);//只会激活流程,并不会触发运行的节点 H3.Workflow.Messages.ActivateActivityMessage activiteMessage = new H3.Workflow.Messages.ActivateActivityMessage(this.Request.InstanceId, "Activity2", H3.Workflow.Instance.Token.UnspecifiedId, new string[] {}, null, false, H3.Workflow.WorkItem.ActionEventType.Adjust);//参数对应描述:流程实例ID,活动节点编码,令牌ID,参与者,前驱令牌,是否检测入口条件,激活类型 this.Request.Engine.WorkflowInstanceManager.SendMessage(activiteMessage);//1.不会取消正在运行的节点。2.进行中的流程才能激活调整。 }
组织管理
人员数据 H_user
部门id H_user.parentid
氚云一个人一个部门
设置权限的时候部门是不能递归的
权限设置分两部分,一部分是直接从顶顶同步过来,一部分是自定义
不支持对组织机构的操作
//根据用户ID获取用户对象
H3.Organization.User user = Engine.Organization.GetUnit(this.Request.UserContext.UserId) as H3.Organization.User;
标签:WorkflowInstanceState,Workflow,H3,流程,BizObject,Request,Instance,组织,操作 来源: https://www.cnblogs.com/FaustDream/p/16136303.html