How to query a database from UserApp Workflow


Hi All,

How can we query a database from UserApp workflow? We do not have a web
service involvement here.
We need to query a database real time when performing a user
registration and populate a drop down list in the workflow. PFB the
queries:

1. Where in the workflow should we include the query and how to do it?
2. Details on how to create and connect to database connection?

Thanks in advance.


--
sai86
------------------------------------------------------------------------
sai86's Profile: https://forums.netiq.com/member.php?userid=9596
View this thread: https://forums.netiq.com/showthread.php?t=53879

  • On 7/14/2015 6:54 AM, sai86 wrote:
    >
    > Hi All,
    >
    > How can we query a database from UserApp workflow? We do not have a web
    > service involvement here.
    > We need to query a database real time when performing a user
    > registration and populate a drop down list in the workflow. PFB the
    > queries:
    >
    > 1. Where in the workflow should we include the query and how to do it?
    > 2. Details on how to create and connect to database connection?


    Out of the box, I am not aware of any specific functionality.

    In Form it would be hard, since you run in the Users' web browser context.

    In the Workflow, you can call out to Javascript or Java, find a sample
    of how to connect and query in Java/JS and use that in a workflow at any
    point you have ECMA/JS that executes. In a Map, in a Entity Action, or
    whatever makes sense.



  • You are not going to be able to do that without some "proto-matter" (if
    you don't know what that is watch Star Trek 3 The Search for Spock)...

    To get serious, while Geoff is correct you can do this from Workflow,
    you are actually asking to do it from a form. In the workflow, the ECMA
    is running from the server, so you can try to load any java class you
    wish, in the form, you are running everything from the browser. You must
    do this with a SOAP or REST service, and you must adhere to or work
    around the Same Origin Policy built into every browser. The most simple
    way to do that is to integrate a web service with the UA's web
    application server so that it's at the same base URL.

    It can be done (I have done it). But it's far from trivial.


    --
    rrawson
    ------------------------------------------------------------------------
    rrawson's Profile: https://forums.netiq.com/member.php?userid=403
    View this thread: https://forums.netiq.com/showthread.php?t=53879


  • I've done similar call from user app form to database with the help
    AJAX/Jquery. I've explined in another post, please have a look..

    http://tinyurl.com/ooawm6b

    Regards
    Nirmal Dhanaraj


    --
    dhanarajn
    ------------------------------------------------------------------------
    dhanarajn's Profile: https://forums.netiq.com/member.php?userid=4357
    View this thread: https://forums.netiq.com/showthread.php?t=53879