系统事件#
此任务会侦听主题,并在发生事件时发出提示。它接收消息总线消息并输出其数据。
输入#
| 名称 | 数据类型 | 是否是触发器 | 描述 |
|---|---|---|---|
| 回复 | Object | 否 | 作为SendRequest调用应答发送的回复输入对象 |
| 激活 | any | 是 | 激活系统事件的侦听器 |
输出#
| 名称 | 数据类型 | 描述 |
|---|---|---|
| 数据 | Object | 接收到的消息的内容 |
| 时间戳 | DateTime | 接收消息时的时间戳 |
设置#
在“常规”选项卡上,您有常用设置和以下设置:
| 名称 | 数据类型 | 默认 | 描述 |
|---|---|---|---|
| 操作组 | String | 此任务订阅的操作组 | |
| 回复超时 | Integer | 60000 | 发出回复的时间窗口。之后,事务将被中止 |
行为#
此任务会订阅MES操作组并侦听系统事件。当事件被触发时,它会读取消息总线消息并发出其数据。如果在回复超时时间内没有收到回复,则事务将被中止。
备注#
如果需要回复,那么如果该任务接收到数据并向任务的reply输入发送了回复,那么就会有一个反馈系统。
此任务使用基于上下文的数据的特定结构,称为zone。有关此主题的更多信息,请参阅区域页面。
示例#
用于发布内容的DEE操作代码:
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", "");
Resource res = new Resource();
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操作代码:
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", "");
Resource res = new Resource();
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 + "**" );
}

