cancel
Showing results for 
Search instead for 
Did you mean: 

Condition Editor

silentbull
Participant
0 Kudos

Hello

I have the following xml and require this condition to be given in the condition editor of receiver determination.

But it is not working.

(/podPoc/journey/site/task/@taskName = Asset Returns AND /podPoc/journey/site/task/activity/@activityName EX  AND /podPoc/journey/site/task/activity/@number EX )

The XML file below

-<task imageNo="TR010000008739B82581B83B0268C187D9A7EBAA15BD140A1819F7675D" taskEndTime="2016-01-03T02:56:59.827" taskStartTime="2016-01-03T02:56:46.070" taskName="Asset Deliveries">

<activity number="2.000" text="" activityName="BB Basket"/>

</task>

The receiver should  be determined if the task name ='Asset Deliveries' and has values in activity number/text/activityname. Sometimes the attribute might not come or be empty.

Let me know whether these can be handled via condition editor else i might need to create enhanced RD via mapping.

Regards

Sam

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Sam,

Try like below.

Xpath./podPoc/journey/site/task/@taskName = "Asset Returns"  AND  EXISTS(Xpath./podPoc/journey/site/task/activity/@activityName)  AND EXISTS(Xpath./podPoc/journey/site/task/activity/@number)

Regards,

Praveen.

silentbull
Participant
0 Kudos

Hi Praveen

Can you paste screenshot as I am not sure whether I can copy this and paste . How do i select

former_member182412
Active Contributor
0 Kudos

Hi Sam,

First select the xpath (double click on the xpath you want) then it will be appear in left hand side.

Next click on Equal To then give the string in quotes. after that click on Exists operator then double click on the xpath you want.

Regards,

Praveen.

silentbull
Participant
0 Kudos

Thanks praveen,

Forgot to mention that I have a PI7.01 system only.

All it shows is the xpath node and EX function as you see in the screenshot below.

former_member182412
Active Contributor
0 Kudos

Hi Sam,

Use the below operator instead of equals operator.

Regards,

Praveen.

silentbull
Participant
0 Kudos

Hello Praveen

I can't use that operator without giving anything on the right hand side operand.

Regards

Sam

former_member182412
Active Contributor
0 Kudos

Hi Sam,

I took the below input file and it works for me.

I used below XPATH condition.

Make sure namespace mentioned in the condition editor if your incoming xml file has the namespace like below.

Regards,

Praveen.

silentbull
Participant
0 Kudos

Hello Praveen

thanks for the screenshots, unfortunately, it still doesn't work for me.

Please find relevant screenshots where it still creates the receiver.

Regards

Sam

1st screenshot - Condition where you can see no prefix is needed as it does not show any p1.

2nd sreenshot -

                               Actual Payload

Appreciate if you can let me know any other alternatives or UDF to sort this out in receiver mapping.

Regards

Sam

justin_santhanam
Active Contributor
0 Kudos

Hello Sam,

Do you mind attaching the actual XML file to this thread?

Thanks!

former_member182412
Active Contributor
0 Kudos

Hi Sam,

If you want to check existence of number and activityName under the specific task then use below condition.

Just paste the below xpath condition in the box i shown you below.

/podPoc/journey/site/task[(@taskName="Asset Returns") and (count(activity/@number) > 0) and (count(activity/@activityName) > 0)]

Use exists operator like below, The condition should be like below.

It works for me, try your side and let me know.

Regards,

Praveen.

Answers (2)

Answers (2)

silentbull
Participant
0 Kudos

Thanks Praveen

that worked

silentbull
Participant
0 Kudos

Hello

It is not working.

I have decided to handle it via mapping. Still not working via mapping.

Can someone give me a simple udf to handle this.

Regards

Sam

justin_santhanam
Active Contributor
0 Kudos

Hello Sam,

Will you get multiple <task> in the XML? If yes can you enable Multiline and test it ? Let us know the results. If it didn't help then we will see what the next options are.

Thanks.

silentbull
Participant
0 Kudos

Hello Justin

Yes, i am getting multiple task and each task has a different name.

Tried with multiline, it is not working.

Regards

Sam