Element Object Check

Hi All,

I hope you and your families are safe and well.

I have a document which I loop over, say…

/xmldoc/segment1/segment2/segment3/segment4

Segment4(a selection of grouped elements) is only put into the outcoming document by the ERP when certain conditions are met in the order. Like i said I loop /xmldoc/segment1/segment2/segment3/segment4 but could someone tell me what the expression would be to check that it exists and then run the mapping according if it does?

I’ve tried

Loop
–>Branch
–>--> Sequence %/xmldoc/segment1/segment2/segment3/segment4% = null
–>—>Sequence

but it doesn’t pick it up

Thank you in advance

Hi,

please provide some more details about your implementation:

  • What is the input array of the loop step?
  • Is the branch set to “evaluate labels” or “switch”?

Can you provide a screen shot of the loop snippet of your service?

Regards,
Holger

Hi Holger,

Really kind of you to reply. I hope you and your family are safe and well.

So Holger1 shows my initial mapping from the entire document (Holger0) to a single ‘E1EDP20’ record which I call ‘E1EDP20_Temp’ in the pipeline.

Holger2 shows the record/segment definition.

Holger3 shows my Loop and sequence. Please ignore ‘$default’ I appreciate they are wrong.

As I said, E1EDP20 doesn’t always appear in the document, therefore would not populate ‘E1EDP20_Temp’ … My question is how do I check with a regular expression that ‘E1EDP20_Temp’ is populated with any data so that I can branch using whether it has data or it does not.

Thank you sooo much for responding Holger
Holger1.JPG
Holger2.JPG

Holger3 attached

Sorry… Holger3 attached

Hi John,

I would prefer to check if the original structure has data before mapping it and only map it when it has data.
This is easier to check as doing it afterwards.
Might be that the target will be initialized with "null"s when source does not exist.

Regards,
Holger

Dear Holger,

Thank you soo much for responding. Very kind of you as always.

That makes sense but could you tell me how to check the, “original structure has data before mapping it and only map it when it has data.”??

Hope you and your family is save and well

John

Hi John,

you will need a BRANCH to check the structure for $null or “” (empty string) and only map if this validates to false.
When this results in true just skip the step for the mapping.

Regards,
Holger