上期降到了怎样部署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. Java深入浅出系列(四)——深入剖析动态代理--从静态代理到动态代理的演化

    静态代理 如上图,在程序执行之前.程序猿就要编写Proxy.然后进行编译,即在程序执行之前,代理类的字节码文件就已经生成了(Proxy类的class文件已经存在了). 静态代理尽管在增强现有的接口业务 ...

  2. protobuf-net precompile

    之前游戏为了解决在ios自动更新的问题,想到使用了将游戏代码打包成dll,使用反射加载执行的办法.办法想好了以后,一直没有做测试.上周不知道什么原因,终于有人去测试了,结果发现报错了.我当时觉得有点意 ...

  3. POJ 题目3667 Hotel(线段树,区间更新查询,求连续区间)

    Hotel Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 13805   Accepted: 5996 Descriptio ...

  4. Index statistics collected bug

    SQL运行引擎会从pg_stats.pg_class等相关系统字典表.视图获取生成最佳运行计划的数据,假设相关字典视图的数据不准确就没有办法生成良好的运行计划. 发现下面Bug一枚. 0. 插入数据之 ...

  5. FourCC

    https://en.wikipedia.org/wiki/FourCC A FourCC (literally, four-character code) is a sequence of four ...

  6. User32.dll详细介绍

    RegisterServiceProcess(ProcessID:Long,Type:Long) 该函数存在于Kernal32.dll中. Process指向进程的ID,Type表示是否向系统注册该进 ...

  7. 【POJ 3159】 Candies

    [题目链接] 点击打开链接 [算法] 差分约束系统 [代码] #include <algorithm> #include <bitset> #include <cctyp ...

  8. Timer A UP mode 中断

    Timer_A, Toggle P1.0, CCR0 Up Mode ISR, DCO SMCLK //  Description: Toggle P1.0 using software and TA ...

  9. Django-CKeditor使用笔记

    1. 安装django-ckeditor $ pip install django-ckeditor 2. 在setting中,添加ckeditor , ckeditor_uploader 到INST ...

  10. Paratroopers(最小割模型)

    http://poj.org/problem?id=3308 题意:一个m*n的网格,有L位火星空降兵降落在网格中,地球卫士为了能同时消灭他们,在网格的行或列安装了一个枪支,每行或每列的枪支都能消灭这 ...