Search external database

211 views
Skip to first unread message

Prachi

unread,
Feb 18, 2015, 9:53:38 AM2/18/15
to suppor...@runmyprocess.com
Hello,

I'm trying to perform search in external database from the web interface. I've been following this post https://groups.google.com/a/runmyprocess.com/forum/#!searchin/supportforum/sending$20variables$20to$20connector/supportforum/-m3EcwqSdG8/BtuNJyikJZAJ. However some things are not clear to me.

I have a connector with query to perform the search and a composite api to that connector. I also have a text input and a button. The connector is working when I perform a test. My question is where exactly do I add the api listener js script? I've tried adding the script to the button and to api listener completed event tab, it always gives error. This is my script:

function ok(P_computed){
alert(JSON.stringify(P_computed));
}

function ko(P_error){
alert(JSON.stringify(P_error));
}

var input = {"input":"Test"};


var options = {};


id_123456.trigger(input,options,ok,ko);

What value does the 'input' variable exactly have? Is it the value typed in text field?

My second question is how to retrieve the json output I receive and display on WI? The post I referred to above mentioned "creating a output variable in your connector task". Where exactly do I add this output variable?

Thank you.
--


teknion.com <http://www.teknion.com>

<http://www.teknioncre8.com/> <http://www.facebook.com/Teknion>
<http://www.linkedin.com/company/teknion> <http://twitter.com/teknion>
<http://www.youtube.com/teknion>

Please consider the environment before printing this e-mail.

CONFIDENTIALITY NOTICE: This communication, including any attachments, may
contain information that is confidential and privileged. [It may constitute
non-public information and is intended to be conveyed only to the
designated recipient(s).] If the reader or recipient of this communication
is not the intended recipient, or you believe that you have received this
communication in error, please notify us immediately by return e-mail and
promptly delete this e-mail including any attachments without reading or
saving them in any manner. Any other distribution, copying or disclosure is
prohibited and may be unlawful. We accept no responsibility for changes
made to this e-mail or to any attachments after transmission from our
office.

Prachi

unread,
Feb 19, 2015, 8:54:03 AM2/19/15
to suppor...@runmyprocess.com, prachi....@teknion.com
Hi, can someone please give some input? I'm still not able to get the api working.

Thank you.

Sushma Padidela

unread,
Feb 19, 2015, 7:45:56 PM2/19/15
to suppor...@runmyprocess.com, prachi....@teknion.com
Hi Prachi,

As your connector alone is working and getting the output. You need to store this in a variable in output variables of the connector activity after you attach the connector to your Composite API.

Next from your email i understand that you created a Composite API and you have the above connector activity in it.

As you want to search on button click, the code to trigger the composite API can be written in the button by selecting its type to "Execute Script" or it can also be written in a JavaScript widget and listening to the text_input variable.

The code can be like below:

function ok(P_computed){
alert(JSON.stringify(P_computed));
RMPApplication.set("variable_name",P_computed.output_variable_of_connector);   // variable_name is, the widget variable where you want to show result data.

}

function ko(P_error){
    alert(JSON.stringify(P_error));
}

var input = {"account_name":RMPApplication.get("account_name")};   // account_name is the variable name of your text_input from the web interface.

var options = {};
// or simply var options = {}; to execute the composite API in the mode and the version used by the current web interface

id_comp_api.trigger(input,options,ok,ko);   // You get this id once you attach your Composite API in the API Listner tab of your web interface and select Launch Event as "manually via Javascript"

}

Please refer below documentations for more details.





Thanks,
Sushma
Fujitsu RunMyProcess



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/f0eebd3b-d750-49b2-8a48-6cb527b6324f%40runmyprocess.com.

Prachi

unread,
Feb 20, 2015, 10:48:22 AM2/20/15
to suppor...@runmyprocess.com, prachi....@teknion.com
Hi Sushma,

Thank you for your response. I'm getting the json output now. I'm trying to create output variable but it always gives error saying "Error processing P_result. P_result is not defined."

Instead of output variable I'm trying to parse json in P_computed.

var obj = jQuery.parseJSON(P_computed);
alert(obj.SECStatus);

Thank you.
Reply all
Reply to author
Forward
0 new messages