How to launch a process from another web application or web page?


#1

To launch a process directly from another web application or web page via a link or URL, you can use the following example:

http://YOURSITE/wfgen/show.aspx?QUERY=START&P=PROCESS NAME, where:

  • YOURSITE is the site where WorkflowGen is installed.

  • START is the task WorkflowGen will attempt to run

  • PROCESS NAME is the process name that WorkflowGen will attempt to run

See the Integration using WorkflowGen URLs section in the WorkflowGen Integration Guide for more information and a complete list of available parameters.


#2

Is it possible to set some data variable using Url parameters? Like if I have a data variable called DOC_URL, I could do something like in the Url &DOC_URL=http://urlofdoc/file.doc


#3

Hi,

You can always use the code behind editor to catch any URL parameters and modify process data with them.

What you can do for example:

Let’s say you have http://YOURSITE/wfgen/show.aspx?QUERY=START&P=PROCESS_NAME&URL=http.. In the Page_Load() function, you will call the Request object to get the URL parameter and change the process data afterwards:

protected void Page_Load(object sender, EventArgs e)
	{
	    base.Page_Load(sender, e);
            
         if (Request.QueryString["URL"] != null)
          {
            //put code here to change process data
            FIELD_ID.Text = Request.QueryString["URL"];
          }
     }

Best regards,

Eddy


#4

I tried that. It does not work. Those QueryString variables do not exist. Have you tried it?

I think that it is because WOrkflowGen redirects the forms, but does not include the url parameters initially passed.


#5

You are correct. The query string that it tries to retrieve is from the frame that loads the form and not the parent page.

What you can do however is retrieve the query string with JavaScript, load the value in a field and then you can use that in your code behind.

Try adding this code in your form’s web reference. (Also enable JQuery)

<script>
    if (typeof $selectedObject === "undefined") { 
        alert(getQueryString().URL);
    }
    
    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;
     }
</script>

Note: if your query parameter is called “name” for example, change the code in the 3rd line to alert(getQueryString().name);

Best Regards,
Eddy.