Skip to main content

Plugin Extension - Orchestration Extension

Scenario 1: Extend Selected Node Actions

Add Node Actions

image.png

After selecting a node, action buttons appear in the top-right of the selection box. In addition to the default view parent, copy, and delete buttons implemented by the orchestration module, you can extend more actions through related APIs:

import { plugins } from '@rchh/lowcode-engine';
import { IPublicModelPluginContext, IPublicModelNode } from '@rchh/lowcode-types';
import { Icon, Message } from '@alifd/next';

const addHelloAction = (ctx: IPublicModelPluginContext) => {
return {
async init() {
ctx.material.addBuiltinComponentAction({
name: 'hello',
content: {
icon: <Icon type="atm" />,
title: 'hello',
action(node: IPublicModelNode) {
Message.show('Welcome to Low-Code engine');
},
},
condition: (node: IPublicModelNode) => {
return node.componentMeta.componentName === 'NextTable';
},
important: true,
});
},
};
};
addHelloAction.pluginName = 'addHelloAction';
await plugins.register(addHelloAction);

Result:

image.png

See API reference: API Documentation

Remove Node Actions

import { plugins } from '@rchh/lowcode-engine';
import { IPublicModelPluginContext } from '@rchh/lowcode-types';

const removeCopyAction = (ctx: IPublicModelPluginContext) => {
return {
async init() {
ctx.material.removeBuiltinComponentAction('copy');
},
};
};
removeCopyAction.pluginName = 'removeCopyAction';
await plugins.register(removeCopyAction);

Result:

image.png

See API reference: API Documentation

Real-World Examples

Block Management