intrexx-sample-workflow-integration
Introduction
This project shows how Intrexx workflow objects that interact with external services can be implemented.
MQTT event source
org.example.mqtt.workflow.eventsource.MQTTWorkflowEventSource
Events generated by the MQTT event source
org.example.mqtt.workflow.event.IMQTTMessageWorkflowEvent
org.example.mqtt.workflow.event.IBeforeStartMQTTWorkflowEvent
org.example.mqtt.workflow.event.IAfterStopMQTTWorkflowEvent
Handler for MQTT events
org.example.mqtt.workflow.eventhandler.MQTTWorkflowEventHandler
Action for publishing MQTT messages
org.example.mqtt.workflow.action.MQTTMessageProducerWorkflowAction
Requirements
- Intrexx 10.1 or greater
- Java SE Development Kit 16
For Intrexx 8.0, 8.1, 9.2, and 10.0 see tags intrexx-v8.0, intrexx-v8.1, intrexx-v9.2, intrexx-v10.0 respectively.
Building from source
git clone https://github.com/UnitedPlanet/intrexx-sample-workflow-integration.git
cd intrexx-sample-workflow-integration
./gradlew build
Import as an Eclipse project
git clone https://github.com/UnitedPlanet/intrexx-sample-workflow-integration.git
In Eclipse open File/Import.../Gradle/Existing Gradle Project
, choose the directory
intrexx-sample-workflow-integration
and finish the import wizard.
Accessing MQTT messages from Groovy scripts in Intrexx processes
IMQTTMessageWorkflowEvent
MQTT events generated by the event source contain a reference to the underlying MqttMessage received by the Eclipse Paho Client. The event is accessible in Intrexx Groovy processes via the global g_event
variable:
def msg = g_event.message // the Eclipse Paho message
def payload = msg.payload // the payload as a byte array
def strPayload = new String(payload, "UTF-8") // if the payload is an UTF-8 encoded string
TODO: Documentation