Robin Verhoek

Creating Child Event Frames using SDK

Discussion created by Robin Verhoek on Sep 27, 2012
Latest reply on Sep 27, 2012 by Robin Verhoek

Hi all,

 

 

 

We're having a nagging issue in creating child Event frames using the SDK. Probably any of you have an idea on this? We use all latest versions of PI and AF (2010R3) supporting Event Frames out-of-box.

 

For explanation i use a simple setup of EF Templates:

  • EF Template "Batch"
  • EF Template "Weighing"
  • Reference Type "Parent-Child" setup between these two

Behaviour in the PI System Explorer:

 

Case 1: 

  1. I create a Batch EF under the root element.
  2. In the Child Event Frames tab of the Batch EF, i create a new Weighing Event Frame. On creating, it shows the parent element to be the Batch EF.
  3. Result is a Batch EF, with below that a Child EF, just as expected.

Case 2:

 

  1. I create a Batch EF under the root element.
  2. I create a Weighing EF under the root element.
  3. I drag the In the Weighing EF into the Child Event Frames tab of the Batch EF.
  4. Result is a Batch EF, with below that a Child EF. The Child EF appears under the root node (as we created it, so that's expected), and as a child under the parent EF showing as a "shortcut" with a small arrow (as expected as we added an exising EF under the root to the parent EF).

 

Screenshot from the explorer showing Case 1 (EF_Batch...-001 and EF_Weighing...-002) and Case 2 (EF_Batch...-002 and EF_Weighing...-003):

 

6330.Capture.PNG

 

 

 

Now i try to create the same differences using the SDK (sorry no code snippets yet):

 

Case 1:

  1. I create a Batch EF with no Parent EF set.
  2. I create a Weighing EF with the Batch EF set as Parent.
  3. Result is that the Weighing EF is created, but not with the Batch EF as parent but Root as parent and no parent child relation.

Case 2:

  1. I create a Batch EF with no Parent EF set.
  2. I create a Child EF with no Parent EF set.
  3. I add the Weighing EF to the collection of Child EF of the Batch EF.
  4. Result is identical to the case2 using Explorer.

 

The main question: how to recreate the Case1 from the Explorer using the SDK?

Outcomes