How to launch a new request with context parameters from an external application via a URL


#1

This procedure lets you launch a new process from another application using SDK-style parameters.

Notes

  • The process to be launched must be a public access level sub-process.

  • This solution is not available with WorkflowGen Standard and StandardOne licenses in version 5.

URL

Use the URL http://[myserver]/wfgen/show.aspx?QUERY=PROCESS_START_REMOTE, replacing [myserver] with the name of your server.

Required parameters

  • PROCESS

    Type: String

    Description: Name of process to launch

  • TEST

    Type: String (Y or N)

    Description: Launch process in test mode?

Optional parameters

  • CONTEXT

    Type: String

    Description: XML-structured IN/OUT parameters to send to the process start. If omitted, a default context with NULL values will be created. (See Web Services API: WorkfowContext specifications and usage for instructions on how to create context parameters.)

  • REQUESTER_USERNAME

    Type: String

    Description: Username of the user launching the request. If omitted, the connected user will be used as the requester.

Download SDK_CS_RemoteLaunchURL_v5.zip and follow the instructions in the included setup.txt for an example of usage.


How to launch a new request from an external Application
#2

the following link in this article is dead.http://www.workflowgen.com/kb/web-services-api-workfowcontext-specifications-and-usage. Can you point it to the new location?


#3

Hi Supriya,

This and other integration-related FAQs have been compiled and updated in the new WorkflowGen Integration Guide. The material from the article you were looking for can be found in the Web Services API section.

However, the original FAQ is still available at https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315.


#4

Hello,

can you please give another syntax example for
http://[myserver]/wfgen/show.aspx?QUERY=PROCESS_START_REMOTE

I tried:
http://workflow/wfgen/show.aspx?QUERY=PROCESS_START_REMOTE&PROCESS="SDK_CS_REMOTE_LAUNCH"&TEST="Y"
(–> using the example given)

I am getting the following error notification:
“The process ‘“SDK_CS_REMOTE_LAUNCH”’ cannot be found”.
(–> I tried with several other processes as well)

Am I missing something? Is the syntax incorrect?
How can I call the right process?

Thank you,
regards


WorkflowGen 7.13.1
#5

Hi,

The parameters in your query shouldn’t have quotes.

Try:
http://workflow/wfgen/show.aspx?QUERY=PROCESS_START_REMOTE&PROCESS=SDK_CS_REMOTE_LAUNCH&TEST=Y

Best Regards,
Eddy.


#6

Hi Eddy,
thank you, now it works :slight_smile:
But:
I expected that the request sheet would open in the browser. Instead, I only see the requests’ ID ("ID=“1905”). In order to see the form sheet, I need to go via the portal again.

The goal for the remote launch was, that requesters can launch a request via URL and not need access the portal.
Is that possible? Do I need to add additiotnal parameters to the URL?

Merci,
regards
Konstantin


#7

Hi Konstantin,

If you want to launch a new request and see the webform in the portal then this would be the proper way to launch a new request:

http://YOURSITE/wfgen/show.aspx?QUERY=START&P=SDK_CS_REMOTE_LAUNCH

Kindly see the integration guide on how to use WorkflowGen URLs:
https://advantys.gitbooks.io/workflowgen-integration-guide/content/integration-using-workflowgen-urls.html

Regards,
Eddy.


#8

Hello Eddy,
perfect, now it works.
Thank you for the great help again and the additional Link!
Best regards Konstantin


#9

Hi Eddy,
How can I launch a new request and see the webform AND also pass context parameters?
Thanks,
Rogelio


#11

Hi Rogelio,

We don’t have a single URL that does all of that.

There are two workarounds:
1- A possible workaround will be to make 2 calls. First one to PROCESS_START_REMOTE in order to create the request with a context (you can use WS API or GraphQL too) then start the first action via URL: https://advantys.gitbooks.io/workflowgen-integration-guide/content/integration-using-workflowgen-urls.html#start-an-action-within-the-workflowgen-portal

2- Add additional custom parameters to the URL query.
eg: http://YOURSITE/wfgen/show.aspx?QUERY=START&P=SDK_CS_REMOTE_LAUNCH&REQUEST_SUBJECT=Hello

Then add some custom Javascript / JQuery to retrieve the URL parameter and autofill the values. In this case, we have to retrieve the parent URL’s query parameters since the iframe’s URL does not contain the additional query parameters.

<script>
 function getQueryString() {
    var queryStringKeyValue = window.parent.location.search.replace('?', '').split('&');
    var qsJsonObject = {};
    if (queryStringKeyValue != '') {
        for (i = 0; i < queryStringKeyValue.length; i++) {
            qsJsonObject[queryStringKeyValue[i].split('=')[0]] = queryStringKeyValue[i].split('=')[1];
        }
    }
    return qsJsonObject;
}
            
$(document).ready(function(){
    $("#REQUEST_SUBJECT").val(getQueryString().REQUEST_SUBJECT);
});

</script>

Let me know if this helps.

Regards,
Eddy.


#12

Hi Eddy,

Thank you very much for this response!

Worked it out with this.

Cheers!

Ro