|
专业版就简单多了,直接在OnSubmit中使用这段代码就可以重新激活了。
- protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
- {
- 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.进行中的流程才能激活调整。
- }
- base.OnSubmit(actionName, postValue, response);
- }
复制代码 |
|