Skip to Content
A B

Simple UDF for queues

Hello

I am struggling with an XML file where the structure looks like this.

<task taskName="GRN Capture" taskStartTime="2015-09-25T10:14:26.217" taskEndTime="2015-09-25T10:14:53.423">

                  <activity activityName="Image" text="" activityImageNo="1D00456B-07CD-49F9-8F89-568816C54020"/>

                  <activity activityName="Text Input" text="706061"/>

               </task>

               <task taskName="Asset Deliveries" taskStartTime="2015-09-25T10:14:55.803" taskEndTime="2015-09-25T10:15:06.457" imageNo="TR010000005C0F020F6B991EF710759BD37D8FCC4382751897E9597715">

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

                  <activity activityName="Metal Wheel" text="" number="1.000"/>

               </task>

               <task taskName="Asset Returns" taskStartTime="2015-09-25T10:15:07.307" taskEndTime="2015-09-25T10:15:17.110">

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

                  <activity activityName="Metal Wheel" text="" number="1.000"/>

               </task>

I want to retrieve the value of text="706061"/> where taskname ='GRN Capture'. 

My issue is this taskname GRN can come in any of the position in the task and the subsequent asset deliveries and asset returns might or might not have an activity node. Due to various combinations, my useoneasmany or graphical mapping is not working.

Is there a simple udf where i can retrieve the text = 706061 with the taskname GRN capture which will cater all the permutations and combinations.

Appreciate if you can post that with the parameters as well that i need to pass.

Regards

Sam

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 20, 2015 at 01:37 PM

    Hello Sam,

    I would not go for UDF in this case, as it still requires playing around with contexts. Have you already tried formatByExample function? Together with mapWithDefault and correctly set context it should solve your issue.

    Regards,

    Radek

    Add comment
    10|10000 characters needed characters exceeded