上期降到了怎样部署connected field service(CFS)

我们假设现在IoT 设备是温度监控器, 当温度触发我们之前预设的温度值, IoT会通过IoT Hub 发送IoT Alert到CFS中。 第一次触发, 系统会自动发送reboot的command。

为了有更好的用户体验, 我们需要自动发送command。

自动发送非常简单。

首先,我们需要创建一个workflow

我们的workflow需要在IoT Alert创建的时候触发。

这个workflow需要有以下两步:

1. 获取到当前IoT Alert的GUID

2. 创建IoT device command 并且把IoT Alert的GUID 绑定进去。

首先我们需要创建workflow。

如果不清楚workflow的,可以查看我的workflow 扫盲贴 Step by Step 开发dynamics CRM

public class RetrieveCFSData : CodeActivity
{
[Input("Key")]
public InArgument<string> Key { get; set; } [ReferenceTarget("msdyn_iotalert")]
[Output("IoTAlertId")]
public OutArgument<EntityReference> IoTAlertId { get; set; } protected override void Execute(CodeActivityContext executionContext)
{
//Create the tracing service
ITracingService tracingService = executionContext.GetExtension<ITracingService>(); //Create the context
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
// Obtain the target entity from the input parameters.
Entity iotAlert = (Entity)context.InputParameters["Target"];
var alertId = iotAlert.Attributes["msdyn_iotalertid"].ToString();
//Update Record by using Custom Assembly output parameter
var iotAlertRef = new EntityReference("msdyn_iotalert", new Guid(alertId));
iotAlertRef.Name = "Hello World From Workflow";
IoTAlertId.Set(executionContext, iotAlertRef);
} }
}

我们把这个workflow添加到之前简历好的step当中。不用set properties

并且,我们要创建一个IoT Device Command 的step。

在这个step当中, 我们需要在operator找到我们创建好的step 1 custom workflow。

并且把parent alert 做绑定。

Dynamics 365 CRM Connected Field Service 自动发送command的更多相关文章

  1. Dynamics 365 CRM Connected Field Service 不能接收IoT Alert

    今天浪费了2,3个小时再connected field service(CFS)上面. 状况如下 1. 在CFS中添加了新的customer assets,并且点击了注册按钮. 2. 注册步骤一直在i ...

  2. Dynamics 365 CRM 配置field service mobile

    配置field service mobile其实微软是有官方文档的, 但是没有坑的微软产品不是好产品. 一些细节设置文中还是没有考虑到的. 所以这里带大家配置一下field service mobil ...

  3. Dynamics 365 CRM 部署 Connected Field Service

    微软 Connected Field Service 是一个提供Azure IoT 和 Dynamics 365 连接的这样一个框架 有两种方式部署CFS, 一种是用IoT Hub PaaS, 一种是 ...

  4. Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (一)- 配置 IoT Central和IoT alert

    今天这个系列给大家带来怎样在connected field service中部署IoT Central 并且做连接. 首先, 这里提供微软官方的tutorial的链接https://docs.micr ...

  5. Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (二)- 匹配设备

    上个blog中介绍了我们怎么去部署IoT central和 connected field service做连接. 我们这次介绍怎么把IoT设备在CRM中怎么去注册. 首先我们打开devices,再选 ...

  6. Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (三)- 发送 work order 和 booking 信息给 IoT Central

    首先, 我们可以打开IoT alert, 并且点击上的 create a flow. 接下来,我们使用微软准备好的模板:Sample Contoso- When a work order is cre ...

  7. Dynamics 365 CRM 开发架构简介

    Dynamics 365 CRM提供了多种编程模型,你可以灵活地按需选用最佳模式. 本文是对Dynamics 365 CRM编程模型的综述. 概览 下图表明了Dynamics 365 CRM的主要可编 ...

  8. Dynamics 365 CRM Free up storage 清理Dynamics 365 CRM的空间

    Dynamics 365 CRM 的空间是要买的. 但是很多情况下用户可以去清理CRM从而达到给空间减重的方法 两大使用DB空间大的功能 1. Audit log 审计记录 审计记录是用来记录各个fi ...

  9. Dynamics 365 CRM large instance copy

    使用CRM 大家想必都做过copy. 从一个instance 复制到另外一个instance. 如果你是Dynamics 365 CRM 用户, 并且你的instance超过500GB,甚至1TB+的 ...

随机推荐

  1. stl空间配置器alloc

    new运算包含两阶段操作: 1) 调用::operator new分配内存     2) 调用构造函数构造对象内容 delete运算包含两阶段操作: 1)调用析构函数将对象析构    2)调用::op ...

  2. 使用jcaptcha插件生成验证码

    1.从官网http://jcaptcha.sourceforge.net/下载插件.将对应jar包导入到lib文件夹下 2.创建一个CaptchaServiceSingleton类用来获取jcaptc ...

  3. [Algorithm] Determine if two strings are an anagram

    The anagram test is commonly used to demonstrate how an naive implementation can perform significant ...

  4. [Vue @Component] Handle Errors and Loading with Vue Async Components

    Because async components are not bundled with your app, they need to be loaded when requested. This ...

  5. Tcl学习之--命名空间

    Tcl解释器将全部的命令和全局变量分组管理.这些小组称为命名空间,一个命名空间中的命令和变量不会影响到还有一个命名空间.这些命名空间呈树形组织.一个命名空间的命令能够被还有一个命名空间引入.命名空间树 ...

  6. ios 从rgb array生成UIImage并显示,oc版

    ; ; const size_t Area = Width * Height; ; // rgba std::vector<uint8_t> output(Area*channles); ...

  7. http协议的MP4文件播放问题的分析

    现在手上有两个链接 (1) http://202.108.16.173/cctv/video/8C/35/EB/E8/8C35EBE84E7B483C8741CF9A60154993/gphone/4 ...

  8. /lib/dracut/hooks/shutdown/30-dm-shutdown.sh

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABVQAAAMACAIAAABEqXuoAAAgAElEQVR4nOydPWjryOK3VaZM8RYpU2 ...

  9. istio-禁用/允许sidecar设置

    一.在namespace设置自动注入: 给 default 命名空间设置标签:istio-injection=enabled: $ kubectl label namespace default is ...

  10. 数据库登陆失败原因: 未与信任 SQL Server 连接相关联

    解决方案:用户 'sa' 登录失败.原因: 未与信任 SQL Server 连接相关联. 问题简述: 用户 'sa' 登录失败.原因: 未与信任 SQL Server 连接相关联. 说明: 执行当前 ...