cancel
Showing results for 
Search instead for 
Did you mean: 

Getting all values from a queue

former_member457420
Participant
0 Kudos

Hi all,

I have a queue as follows:

[123] - intital Context

[sollinger Str]

[123] - CC

[Solinger Str]

[123] - Final context

An image of the queue looks as follows:

[http://i42.tinypic.com/hsj052.jpg]

Iam getting this queue in a userdefined function. I want to get or copy all the values from this queue to a new array as follows without any contexts.

That is, I want to have a queue as follows from the above queue.

[123]

[sollinger Str]

[123]

[Solinger Str]

[123]

How could that be done...

Thanks

P

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

use removeContexts before your UDF.

former_member457420
Participant
0 Kudos

Hi stefan you again

Remove context gives me a queue as follows:

123 - Initial Context

sollinger str

sollinger str

123 - Final Context

That wont work because Iam miising the middle value 123.

I want to have all VALUES without any intial or CC from this queue so that I could add my contexts as I want.....

if thats not possible,i will tell u my real problem

Edited by: pazzuzu on May 6, 2010 11:03 AM

stefan_grube
Active Contributor
0 Kudos

the 123 is not a value in your queue.

For any reason i do not know, the gray context change entries in the queue carry a value.

This value is not really in the queue. It is a fake value.

This fake value has been with XI 3.0 SP 13 and nobody complaint about it so far

former_member457420
Participant
0 Kudos

Iam Trying to do a mapping as follows:

E1EDPA1 -STRAS TO target E1EDPA1 -STRAS.

Check the image link below:

http://i44.tinypic.com/2bek5f.jpg

"checkPar" is my user defined function.

Now I have put the queues for "PARVW" on the left and "if" queue on the right.

For Partners "AP" AND "LF" there is no "STRAS" field(Iam putting constant there).so my output queue of "If" should look as follows

so that it matches the values of the "PARVW" queue.

PARvW -Queue

SUPPRESS

AP

YG

LF

CC

YG

LF

FinalContext

If Output- -Queue

Initial Context

123

sollinger...

123

CC

Sollinger...

123

FinalContext

Edited by: pazzuzu on May 6, 2010 11:25 AM

Edited by: pazzuzu on May 6, 2010 11:27 AM

stefan_grube
Active Contributor
0 Kudos

Use mapWithDefault instead of if

former_member457420
Participant
0 Kudos

Could you please elaborate where I should I fit in the "MapWithDefault" in my mapping.

Former Member
0 Kudos

It's simple...

Just map STRAS --- MapWithDefault(double click and enter 123) ---UDF. (Remove the 'if' function from mapping)

former_member457420
Participant
0 Kudos

Did it....

The following is my input queues for "checkPar".

http://i40.tinypic.com/2iruhrp.jpg

My UDF execution type is set as "All Values Of Context".

so what Iam thinking is,In the "RemoveContext" queue ,in my UDF I will put a CC SO that it looks as follows:

Then it matches the "PARVW"queue in context and numbers.

12

sollinger...

12

CC

sollinger...

12

The question from my side is, as the execution type of my UDF is "All Values Of Context".After i Insert this CC in my 2nd queue will it it processed as 2 queues.

stefan_grube
Active Contributor
0 Kudos

> The question from my side is, as the execution type of my UDF is "All Values Of Context".After i Insert this CC in my 2nd queue will it it processed as 2 queues.

Even when your UDF is "All Values Of Context", you can add CC here so the result might have more contexts as before.

Former Member
0 Kudos

I am not sure what is inside your UDF code and why you have created.

BTW, For your currect problem you have to use the function FormatByExample to set the context changes as per your need. Try to search on SDN and find any blog which describs about this function.

Try this..

outut of checkPAR ----------
                            FormatByExample ---- STRAS
PARVW (set the context)-----

former_member457420
Participant
0 Kudos

Hi guys...thanks 1 more thing

If My inbound queue "a" is as follows:

SUPRESS

AP

YG

LF

contextChange

YG

LF

Final Context

In my Queue "b" which is as follows

SUPRESS

123

sollinger...

123

Sollinger...

123

FinalContext

My requirement is in my "b" queue , I want to put a CC as follows by using a standard node function if possible

SUPRESS

123

sollinger...

123

contextChange

Sollinger...

123

FinalContext

IF THAT dont work Inside my UDF I want to put thE CC for the b queue.

How will the loop behave then?

What will be passed to my input queue "a" and "b" when execute "all values on context" is set.

"a" has a context and "b" doent have one.

My UDF

public static void Test(String[] a,

String[] b,

ResultList result,

Container container){

//Contains no context change

String b[] = {ResultList.SUPPRESS,"12","sollinger","12","sollinger","12",

ResultList.CC};

I make the following steps

copy to an arraylist. add a context change in between.

copy back to string b.

}

former_member457420
Participant
0 Kudos

Sarvesh,

My UDF checkpar takes 2 queues.

1.parvw

I want to use FormatByExample on "stras" so that I could pass this queue as 2nd parameter to my UDF

Former Member
0 Kudos

> If My inbound queue "a" is as follows:

>

> SUPRESS

> AP

> YG

> LF

> contextChange

> YG

> LF

> Final Context

>

>

> In my Queue "b" which is as follows

>

>

> SUPRESS

> 123

> sollinger...

> 123

> Sollinger...

> 123

> FinalContext

>

>

> My requirement is in my "b" queue , I want to put a CC as follows by using a standard node function if possible

>

> SUPRESS

> 123

> sollinger...

> 123

> contextChange

> Sollinger...

> 123

> FinalContext

I have alreday give the solution for this in my previous reply. Once again here it is..

b----
     formatByExample ---- target node.
a----

stefan_grube
Active Contributor
0 Kudos

It seems that you want to code the function "formatByExample"

I have done this already:

/people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

former_member457420
Participant
0 Kudos

Thanks Sarvesh,

It worked with the format by example.

Could you guys answer my question reagrding the UDF

former_member457420
Participant
0 Kudos

Thanks stefan and sarvesh....

You guys made my day ...:)

Answers (1)

Answers (1)

Former Member
0 Kudos

[http://i42.tinypic.com/hsj052.jpg]

From the above queue as mentioned in the link, If you use ReoveContext then you will get output as shown below:

[sollinger Str]

[sollinger Str]

You cannot get the suppress values in a queue, you have to change your UDF code and in order to get [123] as value in your queue.

[123]

[sollinger Str]

[123]

[sollinger Str]

[123]