OPPID - How to notify related components of property value change: Bubble, Connector, Annotation, Sp


Original Author: Gerd Eichler

Introduction

This example explains how to propagate property values from one component to a related component. Example Project Administrator requirements will given along with the information to accomplish them.

Description of the custom attribute

The BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute is placed on a property. It holds an array of BMF_NOTIFY_RELATIONSHIP structures. The table below describes the properties of this structure.

Property NameValue TypeDescription

RELATIONSHIP_CLASS_NAME

text

Relationship class name, in which this component is either source/target

NOTIFY_TARGET

True/False

True to notify target of relationship

False to notify source of relationship

Defaults to true

RELATED_CLASS_NAME*

text

Used to filter down the classes that get updated.  If not filled out all items of the related type will be updated

RELATED_CLASS_PROPERTY_NAME*

text

Property Name of a Related Class that will be updated as result of this property change.  This is only required if the property names differ.

CASCADE_PROPERTY_VALUE_CHANGE*

True/False

True to cascade the changed property value to the related property value.

False to only set related property value if no default 

Defaults to False

SET_DEFAULT_PROPERTY_VALUE*

True/False

True to set the related property value’s default

False to leave the related property value’s default alone

Defaults to False

*designates optional properties

Definition:

Source relates to target, ex. RUN_HAS_IN_RUN. The relationship source is the component on the left side. The relationship target is the component on the right side. If you think of it as a sentence, the source is the subject. Pipe run is the source and valve (an in run) is the target.

Using required notification properties

Spec Break 

A spec break must be notified when a pipe run's specification is changed.

  1. Edit the project schema, ex OpenPlant_PID.01.02.ecschema.xml.
  2. Find the PIPING_NETWORK_SEGMENT class
  3. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the SPECIFICATION property.
  4. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. A spec break behaves like data change component. The DATA_CHANGE_CONNECTS_TO_RUN relationship relates spec breaks, reducers, etc to a pipe run. 
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to DATA_CHANGE_CONNECTS_TO_RUN. 
      3.  Since this property is on the run, the spec break is the source of the relationship; set NOTIFY_TARGET to False.

Page Connector

A page connector, valve, and inline flow element must be notified when a pipe run's name is changed.

  1. Edit the project schema, ex OpenPlant_PID.01.02.ecschema.xml.
  2. Find the PIPING_NETWORK_SEGMENT class
  3. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the NAME property.
  4. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. A page connector behaves like an end run component. The END_RUN_CONNECTS_TO_RUN relationship relates page connectors, blind flanges, caps, etc to a pipe run.
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to END_RUN_CONNECTS_TO_RUN.
      3. Since this property is on the run, the page connector is the source of the relationship; set NOTIFY_TARGET to False.
    2. Valve and inline flow elements behave like an in run component. The RUN_HAS_IN_RUN relationship is used for these.
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to RUN_HAS_IN_RUN.
      3. Since this property is on the run, the valve is the target of the relationship; set NOTIFY_TARGET to True.

 

Using optional property name and cascading notification properties

Notify Control Valve Bubble 

A control valve's bubble must be notified when the control valve's device type code and number are changed.

  1. Edit the project supplemental schema, ex OpenPlant_PID_Supplemental_Imperial.01.01.ecschema.xml.
  2. Find the INSTRUMENT class
  3. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the DEVICE_TYPE_CODE property.
  4. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. A control valve behaves like an in run component. The RUN_LINK_HAS_BUBBLE relationship relates page connectors (END_RUN), control valves (IN_RUN), pressure safety valves (DATA_CHANGE), etc to a bubble.
      1.  Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to RUN_LINK_HAS_BUBBLE.
      3. Since this property is on the control valve, the bubble is the target of the relationship; set NOTIFY_TARGET to True.
      4. The value of device type code is annotated by the bubble's text1 property. Set RELATED_CLASS_PROPERTY_NAME to TEXT1.
      5. Whenever the control valve's device type code changes, the bubble's annotation of it should also change. Set CASCADE_PROPERTY_VALUE_CHANGE to True.
  5. 5. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the NUMBER property.
  6. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1.  A control valve behaves like an in run component. The RUN_LINK_HAS_BUBBLE relationship relates page connectors (END_RUN), control valves (IN_RUN), pressure safety valves (DATA_CHANGE), etc to a bubble.
      1.  Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to RUN_LINK_HAS_BUBBLE.
      3. Since this property is on the control valve, the bubble is the target of the relationship; set NOTIFY_TARGET to True.
      4. The value of number is annotated by the bubble's text2 property. Set RELATED_CLASS_PROPERTY_NAME to TEXT2.
      5. Whenever the control valve's number changes, the bubble's annotation of it should also change. Set CASCADE_PROPERTY_VALUE_CHANGE to True.

Default  Pipeline Size

A new pipe run's size should default to its pipeline's size

  1. Edit the project supplemental schema, ex OpenPlant_PID_Supplemental_Imperial.01.01.ecschema.xml
  2. Find the PIPING_NETWORK_SYSTEM class
  3. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the DESIGN_SIZE property.
  4. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. PIPELINE_HAS_SEGMENT relates a pipeline to the pipe run.
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to PIPELINE_HAS_SEGMENT.
      3. Since this property is on the pipeline, the pipe run is the target of the relationship; set NOTIFY_TARGET to True.
      4.  The pipeline's design size property equates to the pipe run's size property. Set RELATED_CLASS_PROPERTY_NAME to SIZE.
      5. Whenever the pipeline's design size code changes, you do not want all of its pipe run sizes changing. Set CASCADE_PROPERTY_VALUE_CHANGE to False

Using optional related class and cascading notification properties

Notify intruments in a loop

An instrument loop's instruments must be notified when the instrument loop's device type code and number are changed.

  1. Edit the project supplemental schema, ex OpenPlant_PID_Supplemental_Imperial.01.01.ecschema.xml.
  2. Find the INSTRUMENT_LOOP class
  3. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the DEVICE_TYPE_CODE property.
  4. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. The LOOP_HAS_COMPONENT relates an instrument loop to all of its components, instruments, instrument lines, etc.
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to LOOP_HAS_COMPONENT.
      3. Since this property is on the instrument loop, the instrument is the target of the relationship; set NOTIFY_TARGET to True.
      4. Component includes all components. We only need this information passed to instruments. Set RELATED_CLASS_NAME to INSTRUMENT.
      5. Whenever the instrument loop's device type code changes, the instrument's device type code should also change. Set CASCADE_PROPERTY_VALUE_CHANGE to True.
  5. 5. Add the BMF_NOTIFY_RELATED_COMPONENT_OF_PROPERTY_VALUE_CHANGE custom attribute to the NUMBER property.
  6. Fill in the BMF_NOTIFY_RELATIONSHIPS
    1. The LOOP_HAS_COMPONENT relates an instrument loop to all of its components, instruments, instrument lines, etc.
      1. Add a BMF_NOTIFY_RELATIONSHIP entry
      2. Set the RELATIONSHIP_CLASS_NAME to LOOP_HAS_COMPONENT.
      3. Since this property is on the instrument loop, the instrument is the target of the relationship; set NOTIFY_TARGET to True.
      4. Component includes all components. We only need this information passed to instruments. Set RELATED_CLASS_NAME to INSTRUMENT.
      5. Whenever the instrument loop's number changes, the instrument's number should also change. Set CASCADE_PROPERTY_VALUE_CHANGE to True.