电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

工作流服务插件-自定义流转条件

来源:金蝶云社区作者:金蝶2024-09-163

工作流服务插件-自定义流转条件

## 工作流服务插件-自定义流转条件 1. 用户如何配置自定义条件 本例以配置“发起员工所属组织”作为自定义条件,用户可以在条件项中选择基础资料组织“集团本部”,作为参数传入条件插件中解析条件真假;若发起员工的组织是“集团本部”,则流转到“集团本部”这个节点: ![1.webp](https://wenku.my7c.com/download?fileName=0100a0c55760c5be46ab96d057e5c06501e7.webp) 2. 开发者如何实现自定义条件插件 2.1. 条件插件基类 Kingdee.BOS.Workflow.Kernel.Condition. AbstractConditionExecutorPlugIn 引用组件Kingdee.BOS.Workflow.Kernel.dll,开发者编写的条件执行类需要继承该基类。 2.2. 方法Execute 方法说明:条件执行的核心方法。 C#定义 public virtual void Execute(MapStateContext flowSateContext, List<CustomizeConditionRow> customizeConditionList) 备注:插件中覆写此方法,自行实现条件计算,并将条件计算结果传回流程引擎即可。 | 插件基类 | AbstractConditionExecutorPlugIn | | ---------------------- | ------------------------------------------------------------ | | 所在组件 | Kingdee.BOS.Workflow.Kernel.dll | | 条件执行方法 | void Execute(MapStateContext flowSateContext, List<CustomizeConditionRow> customizeConditionList) | | 方法参数说明: | | | flowSateContext | 流程上下文。可以获取BOS上下文、单据FormId、单据实体对象等。比如:// 示例,如何获取BOS上下文等数据:var context = flowSateContext.MapContext.BOSContext; // 获取BOS上下文var formId = flowSateContext.MapContext.BillFormId; // 获取单据FormIdvar data = flowSateContext.MapContext.BillDataObject; // 获取单据实体对象var originatorId = flowSateContext.MapContext.MapInstance.OriginatorId; // 获取流程发起人用户IDvar originatorPostId = flowSateContext.MapContext.MapInstance.OriginatorPostId; // 获取流程发起人岗位ID | | customizeConditionList | 传入用户在连线上配置的自定义条件集合。可以根据每行条件的conditionRow.ConditionKey属性,获得用户在条件项中配置的基础资料ID,再计算该条件是否满足,计算结果通过conditionRow.ConditionResult传回流程引擎。 | 2.3. 示例插件代码 以下示例插件,举例说明如何解析“发起员工所属组织”连线条件,示例未经测试仅供参考思路。到K/3 Cloud安装目录的WebSite\Bin子目录,引用如下基本组件(其他组件按需引用): Kingdee.BOS.dll Kingdee.BOS.Core.dll Kingdee.BOS.DataEntity.dll Kingdee.BOS.ServiceHelper.dll Kingdee.BOS.Workflow.Kernel.dll Kingdee.BOS.Workflow.ServiceHelper.dll ``` using Kingdee.BOS.Condition; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.ServiceHelper; using Kingdee.BOS.Workflow.Kernel; using Kingdee.BOS.Workflow.Kernel.Condition; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Demo.Workflow.PlugIn.CustomizeCondition { /// <summary> /// 以发起员工所属组织作为条件(本插件仅作为参考示例,未经测试) /// </summary> public class CustomizeConditionStaffOrg : AbstractConditionExecutorPlugIn { public override void Execute(MapStateContext flowSateContext, List<CustomizeConditionRow> customizeConditionList) { var context =flowSateContext.MapContext.BOSContext; // 获取BOS上下文 var originatorId =flowSateContext.MapContext.MapInstance.OriginatorId; // 获取流程发起人用户ID

工作流服务插件-自定义流转条件

## 工作流服务插件-自定义流转条件1. 用户如何配置自定义条件 本例以配置“发起员工所属组织”作为自定义条件,用户可以在条件项中...
点击下载文档文档为doc格式

声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

已经是第一篇
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信