Friday, November 8, 2013

Useoneasmany, FormatByexample and CollapseContext behaviour, difference in context and queue in AUDF

Formatby example




UseOneasMany example





Here, Type may have any number of values, 
But Name(context changed) name(context is not change) should have same values and a
at least one value for all these segments.




for removes context and collapse context:

http://pdpsappireference.blogspot.in/2012/09/difference-between-removes-context-and.html


Know the difference between two types of advanced user defined function

context type USD:

for example  SAL(   1,2, 3  ,CC, 22, 34, CC, 3,5,6,8)  -> CC mean context separation.

for this UDF
if you write udf( context)

for( int i=0,i< var1.length; i++)
{
// it take all values from 1,2,3,
}
//second instenace
for( int i=0,i< var1.length; i++)
{
// it take all values from 22,34  you can result.addValue(" "); result.addSuppress();
}

//second instenace
for( int i=0,i< var1.length; i++)
{
// it take all values from 3,5,6,8  you can result.addValue(" "); result.addSuppress();
}

if the udf type: Queue
for(int i=0; i
{
// it takes all values (1,2,3,22,34,3,5,6,8);
}

/* more information about


a[index].equals(ResultList.CC)


void addValue(String value);
Appends a value to the results list
void addContextChange();
Appends a context change to the list. This can also be achieved if you append the constant ResultList.CC by usingaddValue().
void addSuppress();
Appends the constant ResultList.SUPPRESS to the list. The generation of the target field and its sub nodes is suppressed for such entries.
void clear();
Deletes all previously appended values from the list.

Let us example for Creatif (internal code)


public void myCreateIf(String[] a,
            ResultList result,
            Container container)
{
  for ( int i = 0; i < a.length; i++ )
  {
     if( a[i].equals("true"))
       result.addValue( “” );
     else
       result.addSuppress();
  }
}

// converting string to integer
Integer.parseInt(Count[0])




Avoiding Null values in the context:

EMPLOYEE(EMPID, SAL)  , Some times, emp id has values, unfortunately sal field some time null
but in some cases, we need validate sal filed based on empid. ( the queue values of empid, the queue values are different, this causes some times, difficult pick the right value in queue, comparison is not possible.)

We need make both queue.lenths are same

EMPLOYEE(

empid-> is at upper level context,

sal(not at upper level context)->  mapwithdeafult ->removes context->  formatwithexample(helpOfempid context)->      now both queues are equal

File 2 File sceneario:(FCC: with out mapping logic), But Dynamic configuration informaiton



UseOneAsManyFormatByExample