How to pass parameters to Composite API

328 views
Skip to first unread message

wolfgangsc...@gmail.com

unread,
Oct 13, 2013, 6:07:09 AM10/13/13
to suppor...@runmyprocess.com
Hello,
I have a question regarding the usage of composite APIs.

My scenario is as follows:
In a process I have defined a manual task with an assigned WebInterface. The WebInterface has defined an API listener.
The listener starts a composite API which retrieves data from an employee out of an external database by an SQL script.
Using P_initiator.login in the composite API as the user to retrieve data from the database, everything works fine.
The data are displayed in the WebInterface as expected.

But what I want to do is to pass explicitly a user name to the composite API. In the SQL statement this explicitly passed user should be used to retrieve the data by the SQL statement.

How do I pass parameters into a composite API?
The parameter I want to pass is defined in the main process as variable. But obviously the parameters of the main process are not visible in the composite API. This is different to subprocesses, right?

In the Composite API Configuration tab there is the section "Input validation".
Is this the way to do this? But I do not understand how to handle this in my scenario.

Can someone please explain hwo to do this?

Thank you in advance,
regards
Wolfgang

madhuri.ru...@gmail.com

unread,
Oct 14, 2013, 2:24:02 AM10/14/13
to suppor...@runmyprocess.com, wolfgangsc...@gmail.com

Hi ,
I want to know if your are passing email of user on your web interface in textbox?If you give email of user in textbox,it will fetch its details in web interface.
Eg. User email as textbox-If you enter value in it,it will be passed to your Composite API.Add one input parameter like UserEmail and value as ${user_email},where user_email is variable of your textbox. Same variable will be used in your script.

Please let me know how you want to pass user name/email?via web interface?

Thanks,
Madhuri,Fujitsu

wolfgangsc...@gmail.com

unread,
Oct 14, 2013, 8:47:27 AM10/14/13
to suppor...@runmyprocess.com, wolfgangsc...@gmail.com, madhuri.ru...@gmail.com
Hello Madhuri,
thank you for your reply and the proposal.
In general you are right, what I want to pass to the composite API is the email address of a specific user.
But this email is part of the structure returned by the rmp function ${get_user_data(P_initiator.login)}. In the process I assigned to a process variable a the result of get_user_data(). Therefore the value I need in the composite API is: a.login

The question now is, how to transfer a.login into the composite API "capi", which is assigned to a WebInterface "wi01" and triggered by an API listener?

Is this the only way to do this, as you proposed?
- Add a hidden text widget "txt01" to "wi01"
- Assign the text value to parameter "txt01" from the structure "a" in the section "Output variables" of an activity in the process, e.g. ${a.login}
- Add a "Text input" widget to the WebInterface and add to the property "Properties / Variable" the process variable "txt01".
- Only doing the last step, the paramter txt01 is visible and accessable in the compsote API.

Is that right?

But this means:
- complex structures, e.g. the complete result of the rmp function get_user_data() cannot be passed to the composite API,
- for each value which should be passed to the composite API a hidden dummy widget must be defined in the WebInterface.

Is this right?

regards
Wolfgang (Fujitsu)

Reply all
Reply to author
Forward
0 new messages