Skip to main content
Version: Next

Other Coded Bricks

In addition to the legacy coded bricks (Function, Action, and Visual Component), you can also code other types of bricks.

Coded Service​

It is possible to code a Service by simply dragging and dropping a Coded Service brick from the Marketplace into the Project.

It works like any other coded brick; however, you cannot add or remove inputs or outputs. A Service only has a Control Flow input.

Then add it to the relevant Service App so that it is executed when the app starts. Its behavior is the same as that of a non-coded Service.

The generated code will look like this:

import { Brick, registerBrick } from 'olympe';

export default class MyCodedService extends Brick {
update($, inputs, outputs) {
// Put your code here.
// It will be executed when the Service App (backend) starts.
}
}

registerBrick('019...', MyCodedService);

Coded Remote Action​

It is possible to code a Remote Action by simply dragging and dropping a Coded Remote Action brick from the Marketplace into the Project.

It works like any other coded brick, with some default inputs (Control Flow and User) and outputs (Control Flow and Error Flow).

Then add it to the relevant Service App so that it is executed by that app. Its behavior is the same as that of a non-coded Remote Action.

The generated code will look like this. Notice that it extends RemoteAction rather than Brick:

import { RemoteAction, registerBrick } from 'olympe';

export default class MyRemoteAction extends RemoteAction {
update($, [user], [forwardEvent, setErrorFlow]) {
// Put your code here.
// It will be executed when the Remote Action is called.
}
}

registerBrick('019...', MyRemoteAction);