Plex 2E

  • 1.  How to query value objects

    Posted May 18, 2017 03:10 PM

    Hi,

     

    We want to query all values of fields contained in a variable and process those fields. We also want to skip some of the values, which in this case are inherited to a "template" field.

     

    We can't use +IF because we don't know the specific fields that are being processed. We are left with the option for querying specific triples.

     

    Object values support the [VAL name NME], [VAL label LBL] and [VAL topic TPC] triples. Label and Topic kind of pollute the model since they would make all inheriting fields have their own labels and topics. But we digress.

     

    The problem is that for some reason querying for these triples only works if the triples are included directly in the field being queried, and not on sub fields that inherit that particular value. The following queries are never true if they are included in an inherited value:

     

    +If  VAL name NME, Name: SKIP_THIS_FIELD
    +If  VAL topic TPC, Topic: SKIP_THIS_FIELD
    +If  VAL label LBL, Label: SKIP_THIS_FIELD

     

    So, our question is, anyone knows a way of filtering specific inherited values for fields?

     

    Best regards.



  • 2.  Re: How to query value objects
    Best Answer

    Posted May 19, 2017 04:29 AM
    have you tried  +For Each Inheritance Path Object to test inheritence


  • 3.  Re: How to query value objects

    Posted May 19, 2017 05:43 AM

    Hi George.

     

    Thank you for the tip, that worked like a charm. We ended up doing something like this:

     

    +For Each Variable
        +For Each Field
            +For Each Field Value
                Seq Check if is value
                    +++Define  Value: Base Field.Value To Find
                    +++Define  Name: +Value Name
                    +++Undefine  Name: +Found?
                    +++Set Value To Current  Name: +Value Name
                    +If EQ  Name: +Value Name, Value: Base Field.Value To Find
                        +++Define  Name: +Found?
                    +For Each Inheritance Path Object
                        +++Set Value To Current  Name: +Value Name
                        +If EQ  Name: +Value Name, Value: Base Field.Value To Find
                            +++Define  Name: +Found?
                +If  Name: +Found?
                    Comment  // FOUND VALUE!