This blueprint includes 3 examples how to develop custom actions, triggers and observations for the More Platform. The CallWebhookAction allows to specify a url that is callen with a HTTP POST request. The PeriodicTrigger allows to speficy trigger that selects a random participant each configurable period.
- Install Java 17 and set as default
- Checkout the blueprint code
- Checkout the Study Manager Backend
- Install the
io.redlink.more:studymanager-core:1.0.0-SNAPSHOT
on your MavenLocal: Run./mvnw clean install -D maven.install.skip=false -D skipTests
in themore-studymanager-backend
directory. - Build blueprints and install locally: Run
./mvnw clean install
in themore-extension-blueprint
directory.
Open to more-studymanager-backend/studymanager/pom.xml)
and insert a dependency. For all blueprint examples add:
<dependency>
<groupId>io.redlink.more</groupId>
<artifactId>more-action-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.redlink.more</groupId>
<artifactId>more-trigger-extension</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Run the more-studymanager-backend
, the extension is now available.
Most things are described as comments within the code. The documentation is meant to be read in this order:
- CallWebhookActionFactory: learn what a factory is
- CallWebhookAction: learn how configuration and action execution works
- PeriodicTrigger: learn hot to use sdk
The More Action Blueprint can found in the more-action-extension
directory. The example shows a simple webhook caller action.
Like any extension, the code includes (at least) two classes: an action that extends Action<ActionProperties>
and a factory, that extends
ActionFactory<...Action, ActionProperties>
. Find infos about the implementation in these files.
If you want to test the webhook locally we prepared a simple webserver, that establishes a webhook at localhost. Just go to
development/webhook-example
and run node webhook.js
.
The More Trigger Blueprint can be found in the more-trigger-extension
directory. It provides a periodic trigger, that
randomly selects a participant and triggers the actions of the interventions at every period.
This Blueprint can be found in the more-observation-extension
directory. The observation can be used to create and configure
an observation for the PushButton
observation. Note, this observation does not use any sensors but is a good starting point.
The extension app can be found in More APP - Blueprint Branch.
Checkout this link.