Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

PI Counter - UDF Context

$
0
0

Hello,

I have a requirement and need to update value based on a counter..

Source structure

EXCEL

EXCEL_COLUMN

  HEADER

   DET1

   DET2

   DET3

   DET4

 

Target structure

TARGET_S

TARGET

  HEADER_T

   LX*

 

Sample values

Source:

EXCEL

EXCEL_COLUMN

  HEADER

   DET1

   DET4

EXCEL_COLUMN

  HEADER

   DET1

   DET2

   DET4

 

 

expected Target

 

TARGET_S

TARGET

  HEADER_T

   LX1

   LX2

  HEADER_T

   LX1

   LX2

   LX3

 

When I set the counter UDF here is how it's created. which is not expected..

TARGET_S

TARGET

  HEADER_T

   LX1

   LX4

  HEADER_T

   LX1

   LX2

   LX4

 

My requirement is in the source there are occurences of fields DET1,DET2,DET3 and DET4..based on these I need to create LX*..If there is only one occurence of DET(say DET1) then there should be one LX with value LX1..

 

When I write the UDF it sets the counter based on contexts meaning..it updates the counter even for values that are not present.

 

How do I write a UDF that counts only if there is a value in the current context, that way the numbers will be sequential.

 

Please advise.

 

Thank you.

 

Larry.


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>