Skip to Content
author's profile photo Former Member
Former Member

Reg : Logic Needed

Hi Friends,

Can any one please provide logic for this.This will help me lot

My Input structure below mentioned :

<?xml version="1.0" encoding="UTF-8"?>

http://hnwl.com/INFFI00041/DisputeCase">

<Records>

<Invo>BVN0001</Invoice_No>

<Invdate>20101025</Inv_IssueDate>

<Due_Date>20101125</Due_Date>

</Records>

<Records>

<Invoice_No>BVN0001</Invoice_No>

<Inv_IssueDate>20101025</Inv_IssueDate>

<Due_Date>20101124</Due_Date>

</Records>

Condition i need to follow is : 1.If Invo is >10 no need to send that record and if Invo repeats i have to send only latest Due_Date records to target.

Please let me know suitable way to solve this

Thanks,

Dinesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Apr 19, 2011 at 08:34 AM
    1.If Invo is >10 no need to send that record and if Invo repeats i have to send only latest Due_Date records to target.

    <Invo>BVN0001</Invoice_No>

    Invo values is string then how come it is posbielt to check integer value, what exactly your logic?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 19, 2011 at 08:59 AM

    <Invoice_No>BVN0001</Invoice_No>

    Is it like the first 3 will be character and the last 4 will be integers and you have apply the condition on the last 4 integers ?

    If yes then you can write a small UDF (or graphical mapping) and achieve this:

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 19, 2011 at 09:31 AM

    Hi

    You have two options to solve this issue, Graphical mapping and use of substring function for first condition and for second sort function.

    Better aproche is to use one UDF for whole queue and create target structure in this udf.

    Kind Regards

    Maciej

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Chk this:

      Create one UDF:

      Context Type:All values of a queue.

      Input will be 3 varaibale: var1, var2, var3

      int a=0;

      String mm ="";

      for(int i=0;i<var1.length;i++)

      {

      for(int j=0;j<var2.length;j++)

      {

      if(var1[ i ].equals(var2[j])) ("i" and "j" in square brackets)

      {

      a=a+1;

      mm= mm + ";" +var3[j];

      }

      }

      String delimiter =";" ;

      String[] temp = mm.split(delimiter);

      Arrays.sort(temp,Collections.reverseOrder());

      result.addValue(temp[0]);

      a=0;

      mm="";

      }

      Mapping:

      Invoice_No->removeContext->sort->splitByValue(valueChange)->collapseContext->removeContext->

      Invoice_No->removeContext--


      > -
      UDF----->Target.

      Due_Date->removeConetxt----


      >

      Thanks

      Amit

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.