import { $t } from 'platform-core'; import { Processor } from '../Processor'; class ExecutionFlow extends Processor { public getToolbarAction(): any { return { extend: 'add', name: 'executionFlow', label: $t('io.sc.engine.rule.core.enums.ProcessorType.EXECUTION_FLOW'), icon: 'bi-bounding-box-circles', enableIf: (args: any) => { const type = this.context.target.type; return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'EXECUTION_FLOW'); }, }; } public format(row: any): any { const div = document.createElement('div'); div.textContent = row.executionFlow; const result = div.outerHTML; div.parentNode?.removeChild(div); return result; } public getEditorFields(): any { return [ { colSpan: 7, name: 'executionFlow', label: $t('re.resources.designer.processor.grid.entity.executionFlow'), type: 'w-code-mirror', rows: 20, lineNumber: true, toolbar: false, showIf: (args: any) => { return 'EXECUTION_FLOW' === args.form.getFieldValue('type'); }, }, ]; } public getViewerFields(): any { return []; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void {} } export { ExecutionFlow };