Policy Automation for B2C Service

Get Involved. Join the Conversation.

Topic

    Gaston van de Weijer
    How to properly link entities
    Topic posted May 15, 2019 by Gaston van de Weijer 
    37 Views, 1 Comment
    Title:
    How to properly link entities
    Content:

    Hi! 

    I've been struggling to get a link between entities working - for now, it's kinda working but not how it's supposed to.

    I've got two entities: 

    • maintenance steps
    • historic maintenance steps

    For device X, every time it has maintenance, the values should be stored in OSvC. Now, the interval depends on the previous value. 

    Now, what I want to happen is that a maintenance step from 'maintenance step (let's call it step 1), is linked to step 1 in historic maintenance steps. From that, it can collect the last recorded date and value of step 1 and make a decision whether step 1 has to be executed now. 

    This seems to be working: 

    the historical maintenance step (the other maintenance step) is a member of the historical maintenance steps if

    the maintenance step number= the other maintenance step number

    However, not to my satisfaction. It does link the two instances, but when I make more rules, it doesn't seem to know what value of what step I am referring to - it keeps giving me error OPA-E00209.

    Can someone help me with this?

    Version:
    18D
    Code Snippet:

    Comment

     

    • Matt Sevin

      What other rules are you trying to write that result in the error?

      What is the model in terms of all the containment and reference relationships, attribute text, in addition to the entities and their structure, etc.?

      Chances are that some attribute or relationship text is confusing OPM so it isn't understanding what you are trying to express given the model that is defined. 

      OPA-E00209 '{0}' is not available here. You may need to use an entity function to refer to '{1}'. This error often occurs when improperly referring to an entity or relationship. If you are not intending to infer from one entity to another, consider rewording your attributes (see Choose attribute text and attribute names). If you are intending to infer from one entity to another, see Use an entity or relationship in a rule.

      In general, pay specific attention to the attribute and entity text you choose as well as whether you intend to load, have users input or have rules infer the instances of each entity.  For example if you are going to represent maintenance steps and historical maintenance steps,  what is the relationship between them?  Should it be "the maintenance step's historical maintenance steps"  or is there a relationship between historical maintenance steps such as "the historical maintenance step's subsequent historical maintenance steps"?    Are you trying to infer all historical maintenance steps or just determine which ones belong in a relationship to an instance of a maintenance step?  

      Defining clear unambiguous entity, attribute and relationship text is an important part of defining a model that results in easily understood expressions of rules/policies.

      Perhaps with more information regarding the model and rules, someone will be able to provide more specific advice.