--- alias: user-guide-automation-task-core-system-reply tags: - automation tasks description: "This task sends a reply message to a message bus request, paired with a System Action Listener" --- # Send System Action Listener :iot-system-reply-lg: The Send System Action Reply task will reply back to a message bus message that awaits a reply. This task should be used with the `System Action Listener` task. ![Screenshot showing a system action reply interface.](../images/send_system_action_listener.png) ## Inputs | Name | Data Type | Description | | -------- | --------- | ------------------------------------------------ | | Reply | `String` | Message to reply back to the message bus request | | Activate | `any` | Activates the task | ## Outputs | Name | Data Type | Description | | ------- | --------- | ------------------------------------------------------ | | Success | `Boolean` | If there was no problem emits a true | | Error | `Error` | Error that occurred during the processing of this task | ## Settings | Name | Data Type | Default | Description | | ------------- | --------- | ------- | -------------------------------------------------------- | | Default Reply | `String` | 10000 | Default Message to reply back to the message bus request | ## Behavior The Send System Action Reply task will reply back to a message bus message, for this controller instance, received in its execution context. This task should be used with the `System Action Listener` task. ## Example DEE action code to make a publish: ```csharp UseReference("Cmf.Foundation.BusinessObjects.dll", "Cmf.Foundation.BusinessObjects"); UseReference("Cmf.Foundation.BusinessOrchestration.dll", ""); UseReference("", "Cmf.Foundation.Common.Exceptions"); UseReference("", "Cmf.Foundation.Common"); UseReference("Cmf.Navigo.BusinessObjects.dll", "Cmf.Navigo.BusinessObjects"); UseReference("Newtonsoft.Json.dll", "Newtonsoft.Json.Linq"); UseReference("%MicrosoftNetPath%Microsoft.CSharp.dll", ""); var serviceProvider = (IServiceProvider)Input["ServiceProvider"]; IResource res = serviceProvider.GetService(); res.Name = "Anneal-104"; res.Load(); var instance = res.GetAutomationControllerInstance(); if (instance == null) throw new Exception("Resource not connected to any IoT instance"); else { instance.Publish("HelloWorld", "Value"); } ``` DEE action code to make a request and receive a reply: ```csharp UseReference("Cmf.Foundation.BusinessObjects.dll", "Cmf.Foundation.BusinessObjects"); UseReference("Cmf.Foundation.BusinessOrchestration.dll", ""); UseReference("", "Cmf.Foundation.Common.Exceptions"); UseReference("", "Cmf.Foundation.Common"); UseReference("Cmf.Navigo.BusinessObjects.dll", "Cmf.Navigo.BusinessObjects"); UseReference("Newtonsoft.Json.dll", "Newtonsoft.Json.Linq"); UseReference("%MicrosoftNetPath%Microsoft.CSharp.dll", ""); var serviceProvider = (IServiceProvider)Input["ServiceProvider"]; IResource res = serviceProvider.GetService(); res.Name = "Anneal-104"; res.Load(); var instance = res.GetAutomationControllerInstance(); if (instance == null) throw new Exception("Resource not connected to any IoT instance"); else { dynamic reply = instance.SendRequest("HelloWorld", "Request", 10000); throw new Exception(reply == null ? "Nothing received" : "**" + reply.reply + "**" ); } ``` ## Remarks There is no particular remark to be made.