【问题标题】:Azure LogicApp with Conditional Control is not working具有条件控制的 Azure 逻辑应用无法正常工作
【发布时间】:2018-09-09 18:09:42
【问题描述】:

我的服务总线队列正在接收 2 个不同对象的遥测数据。对于 Object1,必须将邮件发送到 MailId1,对于 Object2,j 必须将邮件发送到 MailId2。另外,我必须使用 JSON 遥测中的一些内容作为我的邮件正文。

对于单个对象,它工作正常。在我的逻辑应用程序中,我使用了服务总线(其队列正在接收遥测消息),然后解析 JSON(将内容解析为 JSON),最后使用 SMTP 发送邮件。如果我需要基于 JSON 做出决策,我可以在 LogicApp 中使用什么工作流程?

我使用了 Condition 操作,如下图所示。 在 IF 条件下解析的 JSON 是

{
    "properties": {
        "dbt": {
            "type": "integer"
        },
        "latitude": {
            "type": "number"
        },
        "location": {
            "type": "string"
        },
        "longitude": {
            "type": "number"
        },
        "owner": {
            "type": "string"
        },
        "speed": {
            "type": "integer"
        },
        "stdb": {
            "type": "integer"
        },
        "timeCreated": {
            "type": "integer"
        }
    },
    "type": "object"
}

在 ELSE 条件下解析的 JSON

{
    "properties": {
        "message": {
            "type": "string"
        },
        "owner": {
            "type": "string"
        },
        "timeCreated": {
            "type": "integer"
        }
    },
    "type": "object"
}

对于任一遥测,条件总是失败并执行 else 部分。 IF 部分永远不会执行。我在设置 IF 部分的条件时哪里出错了?

任何帮助都会被占用。

【问题讨论】:

  • @Jayendran,请重新阅读问题,我添加了更多细节
  • 你能检查收到的正文吗?你可能有一些编码问题。
  • @Thomas,我已经在github.com/Dharita/TrackingSimulator上传了模拟器代码和正文
  • 所以 contentData 是 base64 编码的,尝试解码它,是一个函数还是它。另请查看与此问题相关的帖子

标签: azure azure-logic-apps azure-servicebus-queues


【解决方案1】:

您可以使用conditional statements

【讨论】:

    猜你喜欢
    • 2019-01-26
    • 2018-01-31
    • 2013-08-02
    • 2020-08-15
    • 2019-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多