带有条件控制的Azure Logic应用程序无法正常工作

问题描述 投票:0回答:1

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

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

我使用了Condition动作,如下图所示。在IF条件下解析的enter image description here 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"
}

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

任何帮助都会被挪用。

azure azure-logic-apps azure-servicebus-queues
1个回答
1
投票

你可以使用conditional statements

© www.soinside.com 2019 - 2024. All rights reserved.