Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions server/libs/modules/components/script/src/main/resources/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Calling a component inside a script

To call a component inside a script, you need to use the `context.component` object which gives you references to components and their actions. For example, to call `logger` component and its `info` action in `javascript` you can use the following code:
To call a component inside a script, you need to use the `context.component` object which gives you references to components and their actions.

For example, to call `logger` component and its `info` action in `javascript` you can use the following code:

```javascript
function perform(input, context) {
Expand All @@ -10,10 +12,14 @@ function perform(input, context) {
}
```

If you want to call an action of a component which requires a connection you cna define its connection inside the Script editor:
If you want to call an action of a component which requires a connection you can define its connection inside the Script editor:

<div style="position:relative;height:0;width:100%;overflow:hidden;z-index:99999;box-sizing:border-box;padding-bottom:calc(91.03313840% + 32px)"><iframe src="https://www.guidejar.com/embed/8d622f3f-252c-4869-9f01-108111778c71?type=1&controls=on" width="100%" height="100%" style="position:absolute;inset:0" allowfullscreen frameborder="0"></iframe></div>
<div style="position:relative;height:0;width:100%;overflow:hidden;z-index:99999;box-sizing:border-box;padding-bottom:calc(51.63511188% + 32px)">
<iframe src="https://www.guidejar.com/embed/8d622f3f-252c-4869-9f01-108111778c71?type=1&controls=on" width="100%" height="100%" style="height:100%;position:absolute;inset:0" allowfullscreen frameborder="0">
</iframe></div>

You can also define multiple connections of the same component and then reference a particular connection when calling the action:

<div style="position:relative;height:0;width:100%;overflow:hidden;z-index:99999;box-sizing:border-box;padding-bottom:calc(91.03313840% + 32px)"><iframe src="https://www.guidejar.com/embed/81148ac3-e742-43a9-a852-eb1f0ab593d5?type=1&controls=on" width="100%" height="100%" style="position:absolute;inset:0" allowfullscreen frameborder="0"></iframe></div>
<div style="position:relative;height:0;width:100%;overflow:hidden;z-index:99999;box-sizing:border-box;padding-bottom:calc(51.63511188% + 32px)">
<iframe src="https://www.guidejar.com/embed/81148ac3-e742-43a9-a852-eb1f0ab593d5?type=1&controls=on" width="100%" height="100%" style="height:100%;position:absolute;inset:0" allowfullscreen frameborder="0">
</iframe></div>
Loading