1 Reply Latest reply: Feb 14, 2013 3:41 PM by Jasmine Lee-Oracle RSS

    InstanceValueIf without a unique identifier in OPM 10.1

    918947
      Hi,

      I need to get an instance value from a child instance when the condition I use can have the same conclusion in few instances as there is no data I could use to make the conclusion unique.

      The issue is that InstanceValueIf requires to have a condition with a unique conclusion for all instances.

      E.g.:
      A relationship name between entities Global and the bill is the bills (1 to Many).

      the name of the selected bill = InstanceValueIf(the bills, the bill's name, the simplified name = "AAA")

      The problem is that in my scenario few instances can have the simplified name as AAA. In that case OPA will return uncertain as there are few instances that satisfy the condition. I would like to pick the bill's name from any instance where the simplified name = "AAA" because if the simplified name = "AAA", the bill's name will always be either AAA1 or AAA2 for all instances where the simplified name = "AAA", e.g. the bill's name = AAA1 for all instances where the simplified name = AAA.

      I was looking whether I could use alias (maybe ForScope), but from what I understand ForScope still should be able to find a unique value. Am I wrong?

      Is there anything else I could use to get around the problem in OPM 10.1?


      Thank you
        • 1. Re: InstanceValueIf without a unique identifier in OPM 10.1
          Jasmine Lee-Oracle
          If we take your rule above and imagine the following data...

          Instance 1
          the bill's name: Homer
          the bill's simplified name: AAA

          Instance 2
          the bill's name: Marge
          the bill's simplified name: AAA

          ... how is the function meant to know whether 'the name of the selected bill' is Homer or Marge? Or are you saying that it will always be the case that 'the bill's name' will be identical for all instances of the entity where the simplified name is AAA? And you're wondering why the InstanceValueIf still evaluates to uncertain if the values for 'the bill's name' are identical?

          (Side note: All entity attributes should contain the name of the entity in the attribute text, e.g. "the bill's simplified name" rather than "the simplified name".)

          Cheers,
          Jasmine