You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
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 };
|
|
|