Show TOC

Characteristic Procedures (Example)Locate this document in the navigation structure

You can use procedures to define, for example, that the weight of a bicycle is dependent on the material used for the frame and the components selected for the bicycle.

Part 1

You define a procedure for characteristic FRAME_MATERIAL. The value assigned to characteristic FRAME_MATERIAL automatically infers a value for characteristic WEIGHT.

  1. On the Class screen choose the tab page Characteristics . Select characteristic FRAME_MATERIAL and choose Start of the navigation path Characteristic Next navigation step Change Next navigation step . The End of the navigation path Basic data tab page appears.

  2. Choose Start of the navigation path Extras Next navigation step Object dependencies Next navigation step Editor. End of the navigation path

  3. You see the dialog box for selecting the dependency type. Select Procedure.

  4. Enter the following source code for your dependency:

  5. $SELF.WEIGHT = 10 if FRAME_MATERIAL = 'aluminum',

    $SELF.WEIGHT = 14 if FRAME_MATERIAL = ‘steel’.

  6. Save your source code.

  7. On the basic data tab, you see a pushbutton labeled Dependencies.

  8. Save your characteristic.

Part 2

The weight of the bicycle also depends on which components are selected. For example, if mudguards are selected, the weight increases by 0.5 kg.

You define a procedure for characteristic value 'mudguard' of characteristic EXTRAS.

  1. On the Class screen choose the tab page Characteristics . Select characteristic EXTRAS. Choose Start of the navigation path Characteristic Next navigation step Change. End of the navigation path Select the value 'mudguard'.

  2. Choose Start of the navigation path Extras Next navigation step Object dependencies Next navigation step Editor. End of the navigation path

  3. You see the dialog box for selecting the dependency type. Select Procedure.

  4. Enter the following source code:

  5. $SELF.WEIGHT = $SELF.WEIGHT + 0.5

  6. Save your source code.

  7. The O indicator is selected for this value.

  8. Save your characteristic.

If you assign value 'aluminum' to characteristic FRAME_MATERIAL, the value 10kg is entered for characteristic WEIGHT. If you then assign value 'mudguard' to characteristic EXTRAS, 0.5kg is added to the WEIGHT.