【问题标题】:What is the meaning of '/' in following TIBCO expression以下TIBCO表达式中的'/'是什么意思
【发布时间】:2019-09-05 19:21:11
【问题描述】:

我在 Tibco 业务工作模块中有以下代码

$ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent
[pfx4:Ent/pfx4:EntOfferingCode = $Read_DB_Data/group/ROW/EOC]
/pfx4:EntState = "Disabled"

我可以理解是将"EntOfferingCode""EOC" 进行比较,但无法得到"/pfx4:EntState = 'Disabled'" 的表达式?

根据 TIBCO,整个表达式返回一个布尔值。

"/pfx4:entState='Disabled'"是什么意思。是逻辑的还是有条件的还是别的什么?

【问题讨论】:

    标签: xpath tibco tibco-business-works


    【解决方案1】:

    整个表达式是逻辑条件。 '/' 只是 XPath(XML 路径语言)语法中的 xml 模式元素分隔符。你可以从这里开始学习 tibco xpath https://docs.tibco.com/pub/activematrix_businessworks/6.3.0/doc/html/GUID-D319018B-AA74-428D-A034-E477778AD2B6.html

    表达式首先过滤所有具有 EntOfferingCode = $Read_DB_Data/group/ROW/EOC 的“Ent”节点 然后检查过滤结果中是否存在 EntState = "Disabled"

    表达式可以替换为

      not (empty($Start/pfx:GetInformationAndPropertyDetailsResponse/pfx:LicenseInfo/pfx:CoreEnt/pfx:Ent[ pfx:EntOfferingCode= "EOC" and pfx:EntState = "Disabled"]))
    

    例如

    如果架构是这样的

    <?xml version="1.0" encoding="UTF-8"?>
    
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns="http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd"
         targetNamespace="http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
        <xs:element name="GetInformationAndPropertyDetailsResponse">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="LicenseInfo" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="LicenseInfo">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="CoreEnt" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="CoreEnt">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="Ent" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="Ent">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="EntOfferingCode" type="xs:string"/>
                    <xs:element name="EntState" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:schema>
    

    表达式返回真:

    <?xml version = "1.0" encoding = "UTF-8"?>
    <GetInformationAndPropertyDetailsResponse xmlns = "http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd">
        <LicenseInfo>
            <CoreEnt>
                <Ent>
                    <EntOfferingCode>EOC</EntOfferingCode>
                    <EntState>Disabled</EntState>
                </Ent>
            </CoreEnt>
        </LicenseInfo>
    </GetInformationAndPropertyDetailsResponse>
    

    表达式返回 false 为:

    <?xml version = "1.0" encoding = "UTF-8"?>
    <GetInformationAndPropertyDetailsResponse xmlns = "http://www.tibco.com/schemas/TestProcess/Schema/Schema.xsd">
        <LicenseInfo>
            <CoreEnt>
                <Ent>
                    <EntOfferingCode>EOC</EntOfferingCode>
                    <EntState>Enabled</EntState>
                </Ent>
                <Ent>
                    <EntOfferingCode>EOC1</EntOfferingCode>
                    <EntState>Disabled</EntState>
                </Ent>
            </CoreEnt>
        </LicenseInfo>
    </GetInformationAndPropertyDetailsResponse>
    

    如果你只是使用

    $ES_GetInfo/root/pfx4:GetInformationAndPropertyDetailsResponse/pfx4:LicenseInfo/pfx4:CoreEnt/pfx4:Ent/pfx4:EntState = "Disabled"
    

    这两个例子都会返回 true

    【讨论】:

      【解决方案2】:

      如果您的问题是 xslt 表达式是什么意思,它基本上是检查以下内容:

      1. 对于所有 LicenseInfo/CoreEnt/Ent,
      2. 其中 Ent/EntOfferingCode = DB 中的 EOC 值
      3. 检查相应的Enstate是否已禁用
      4. 如果禁用,则输出 true,否则输出 false。

      【讨论】:

        猜你喜欢
        • 2016-11-03
        • 1970-01-01
        • 1970-01-01
        • 2013-08-02
        • 1970-01-01
        • 1970-01-01
        • 2013-10-02
        • 2012-06-10
        • 1970-01-01
        相关资源
        最近更新 更多