| | |
| | | default: |
| | | listenerObj.class = options.value; |
| | | } |
| | | // 注入字段 |
| | | if (options.fields) { |
| | | listenerObj.fields = options.fields.map(field => { |
| | | return createFieldObject(moddle, field, prefix); |
| | | }); |
| | | } |
| | | console.log("注入字段",options.fields) |
| | | return moddle.create(`${prefix}:${isTask ? "TaskListener" : "ExecutionListener"}`, listenerObj); |
| | | } |
| | | |
| | |
| | | |
| | | // 创建 监听器的注入字段 实例 |
| | | export function createFieldObject(moddle, option, prefix) { |
| | | console.log("注入字段option",option) |
| | | const { name, fieldType, string, expression } = option; |
| | | const fieldConfig = fieldType === "string" ? { name, string } : { name, expression }; |
| | | return moddle.create(`${prefix}:Field`, fieldConfig); |