System Event#
This task listens to a subject and is prompted when an event occurs. It receives a Message Bus message and outputs its data.
Warning
This task is currently deprecated and will be removed in future versions.
Inputs#
| Name | Data Type | IsTrigger | Description |
|---|---|---|---|
| reply | Object | No | A reply input object to send as answer to a SendRequest call |
| Activate | any | Yes | Activates the listener for system events |
Outputs#
| Name | Data Type | Description |
|---|---|---|
| data | Object | Contents of the received message |
| timestamp | DateTime | Timestamp for when the message was received |
Settings#
On the General Tab, you have the usual settings and the following settings:
| Name | Data Type | Default | Description |
|---|---|---|---|
| Action Group | String | The action group subscribed by this task | |
| Reply Timeout | Integer | 60000 | Time window for the reply to be emitted. After that the transaction is aborted |
Behavior#
The task subscribes to a MES action group and listens for a system event. When an event is triggered it reads the Message Bus message and emits its data. If a reply does not occur in the reply timeout time, the transaction is aborted.
Remarks#
If a reply is needed will have a feedback system were it receives data and sends a reply to the reply input of the task.
This task uses a specific structure of context-based data called zone. More information on this topic can be read in the Zones page.
Example#
DEE action code to make a publish:
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<IResource>();
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:
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<IResource>();
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 + "**" );
}

