Variable Movement From DocumentList to Pipeline

Hi Forum,

I seem to be having a strange problem. I have a few variables in the form of a DocumentList of the type

Paramater[0]
key
paramater
Paramater[1]
key
paramater

My problem is that i have a particular variable in the key and this varaibale needs to be passed as an input to another target service that i am calling using the invoke function.
i.e In the Paramater[0]/key the value is ipaddress and the Paramater[0]/paramater is 192.168.25.23. The ipaddress is an input paramater to my invoked service using remoteInvoke function. I am not getting a way as to how to pass a variable to the pipeline dynamically i.e a variable with name ipaddress with value 192.168.25.23 should be fed to the pipeline so that my target service gets correctly invoked.

Any ideas are more than welcomed…

thanks,
nightfox.

You can create a Java service to read this document list and then create IData Objects(variable) in the pipeline as desired using the Parameter Key as IData Object name and Parameter Value as IData Object value.

Or you can simply loop over the DocumentList and Branch underneath which checks if the key value is “ipaddress” then map the parameter to desired variable or service.

HTH

Talah,

Firstly thanks for the response.
The problem is that i had given that ipaddress field as an example, i mean it can be any variable it can be ipaddress or text or link or anything so it wouldnt be possible to anticipate writing the all the branches for the same.

Has any one got any idea as to how to go about doing the same in flow lang. i.e creating a variable dynamically in the pipeline on the fly.

Ajay,

I can use your option as a last resort as i do want to know as to how to simulate the same scenario in flow.

nightfox…!

Create one Java Service with two inputs “key” and “parameter” and use below code -

// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String key = IDataUtil.getString( pipelineCursor, “key” );
String parameter = IDataUtil.getString( pipelineCursor, “parameter” );
IDataUtil.remove(pipelineCursor,“key”);
IDataUtil.remove(pipelineCursor,“parameter”);
pipelineCursor.destroy();

// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, key, parameter );
pipelineCursor_1.destroy();

Use this java service as tranformer inside a loop over your listItems and it will create these variables on the fly.

Hope this helps !