# Integration Using WorkflowGen URLs

## Overview

Integrations with external systems using WorkflowGen are possible through the use of WorkflowGen applications, RSS feeds, and the WorkflowGen Web Service API. As well, integrations with WorkflowGen can be performed through the use of URLs to perform the following types of functions:

* Launching requests and actions from any external site, with or without WorkflowGen frames and menus.<br>
* Launching an action in a non-WorkflowGen window and redirecting to another (non-WorkflowGen) website.<br>
* Viewing a follow-up form disconnected from the WorkflowGen User Portal.<br>
* Viewing a graphical follow-up disconnected from the WorkflowGen User Portal.

Use cases could include permitting the seamless integration of WorkflowGen into an external portal, such as Microsoft SharePoint, SAP Portal, DotNetNuke, or other web-based portals. Filling out and submitting web forms as well as following up activities could then be performed without the use of the default WorkflowGen web portal if desired.

To enforce the appropriate security in WorkflowGen, these URL launches require users to authenticate themselves, and therefore work best with Integrated Authentication.

## Launch a new request and start the first action&#x20;

* This starts a new request and launches the first action.<br>
* Participant security is enforced.

### Parameters

The parameters the URL uses are as follows:

| **Parameter**       | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `YOURSITE`          | The site where WorkflowGen is installed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `QUERY`             | The task WorkflowGen will attempt to run, e.g. `START`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `P`                 | The process name or ID that WorkflowGen will attempt to run, e.g. `CLUB_CS_LEAVE` (name); `7` (ID)                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `TEST`              | <p>Set to <code>Y</code> to launch the process in Test mode or to <code>N</code> to launch the process in Active mode</p><p></p><p>✏️ <strong>Note:</strong> If the <code>P</code> parameter is configured as a process ID, this parameter will be ignored.</p>                                                                                                                                                                                                                                                                                                           |
| `BACKURL_SUBMIT`    | <p>The URL that the user will be returned to when submitting the completed form, e.g. <code><http://www.advantys.com></code> </p><p></p><p>✏️ <strong>Note:</strong> As of version 7.15.5, this parameter <strong>ONLY</strong> supports absolute URLs (starting with <code>http\://</code> or <code>https\://</code>), relative URLs (starting with <code>/</code>), or URLs defined in the <code>PortalRedirectAllowedHttpUrls</code> configuration parameter (e.g. <code>value='blank.htm, myPage.htm'</code>)</p>                                                     |
| `BACKTARGET_SUBMIT` | <p>Name of the frame or iFrame to show the redirect page result as defined in the <code>BACKURL\_SUBMIT</code> parameter after the webform action is submitted</p><p></p><p>By default, it uses the <code>parent</code>frame. For example, to show the page in the current frame, you would specify <code>this</code> like so: <code>BACKTARGET\_SUBMIT=this</code><br><br>✏️ <strong>Note:</strong> To be used with and requires <code>BACKURL\_SUBMIT</code> only. </p>                                                                                                 |
| `BACKURL_CANCEL`    | <p>The URL that the user will be returned to when selecting the <code>Back</code> link generated on the top left of the form page, e.g. <code><http://www.workflowgen.com></code></p><p></p><p>✏️ <strong>Note:</strong> As of version 7.15.5, this parameter <strong>ONLY</strong> supports absolute URLs (starting with <code>http\://</code> or <code>https\://</code>), relative URLs (starting with <code>/</code>), or URLs defined in the <code>PortalRedirectAllowedHttpUrls</code> configuration parameter (e.g. <code>value='blank.htm, myPage.htm'</code>)</p> |
| `BACKTARGET_CANCEL` | <p>Name of the frame or iFrame to show the redirect page result as defined in the <code>BACKURL\_CANCEL</code> parameter after the webform action is cancelled<br><br>By default, it uses the <code>parent</code>frame. For example, to show the page in the current frame, you would specify <code>this</code> like so: <code>BACKTARGET\_CANCEL=this</code><br><br>✏️ <strong>Note:</strong> To be used with and requires <code>BACKURL\_CANCEL</code> only.</p>                                                                                                        |
| `FORM_BGCOLOR`      | The background color to use when displaying the forms border, e.g. `white`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

### From within the WorkflowGen portal

* WorkflowGen menus and banners are visible.

To launch a process directly from a link or URL, use the example below:

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

### From within another website

* WorkflowGen menus and banners are hidden.<br>
* A **Back** link is displayed in the top left corner.<br>
* Redirection will be performed upon form submit.

To launch a process directly from a link or URL and redirect back to a website other than WorkflowGen, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=START&P=CLUB_CS_LEAVE&BACKURL_SUBMIT=http://www.advantys.com&BACKURL_CANCEL=http://www.workflowgen.com&FORM_BGCOLOR=white
```

## Launch a new request and start the first action without the WorkflowGen portal

### Parameters

The parameters the URL uses are as follows:

| **Parameter**       | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `YOURSITE`          | The site where WorkflowGen is installed                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `QUERY`             | The task WorkflowGen will attempt to run, e.g. `PROCESS_START`                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `PROCESS`           | The process name that WorkflowGen will attempt to run, e.g. `CLUB_CS_LEAVE`                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `ID_PROCESS`        | <p>The process ID that WorkflowGen will attempt to run, e.g. <code>7</code> <br></p><p>✏️ <strong>Note:</strong> If <code>PROCESS</code> is also set (process name), it will take precedence over <code>ID\_PROCESS</code> (process ID).</p>                                                                                                                                                                                                                                                                          |
| `TEST`              | <p>Set to <code>Y</code> to launch the process in Test mode or to <code>N</code> to launch the process in Active mode</p><p></p><p>✏️ <strong>Note:</strong> This parameter is only compatible with <code>PROCESS</code>.</p>                                                                                                                                                                                                                                                                                         |
| `BACKURL_SUBMIT`    | <p>The URL that the user will be returned to when submitting the completed form, e.g. <code><http://www.advantys.com></code> </p><p></p><p>✏️ <strong>Note:</strong> As of version 7.15.5, this parameter <strong>ONLY</strong> supports absolute URLs (starting with <code>http\://</code> or <code>https\://</code>), relative URLs (starting with <code>/</code>), or URLs defined in the <code>PortalRedirectAllowedHttpUrls</code> configuration parameter (e.g. <code>value='blank.htm, myPage.htm'</code>)</p> |
| `BACKTARGET_SUBMIT` | <p>Name of the frame or iFrame to show the redirect page result as defined in the <code>BACKURL\_SUBMIT</code> parameter after the webform action is submitted</p><p></p><p>By default, it uses the <code>parent</code>frame. For example, to show the page in the current frame, you would specify <code>this</code> like so: <code>BACKTARGET\_SUBMIT=this</code><br><br>✏️ <strong>Note:</strong> To be used with and requires <code>BACKURL\_SUBMIT</code> only. </p>                                             |

To launch a process directly from a link or URL without the WorkflowGen portal, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=PROCESS_START&PROCESS=CLUB_CS_LEAVE&BACKURL_SUBMIT=http://www.advantys.com
```

## Start an existing action&#x20;

* This launches any workflow action that has been created. It can be the first, second, or later action of a workflow.<br>
* Participant security is enforced.

### Parameters

The parameters the URL uses are as follows:

| **Parameter**       | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `YOURSITE`          | The site where WorkflowGen is installed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `QUERY`             | <p>The task WorkflowGen will attempt to run, e.g. <code>APPLICATION\_START</code> or <code>CONTEXT</code></p><ul><li>Use <code>APPLICATION\_START</code> when hiding the WorkflowGen menus and banners</li><li>Use <code>CONTEXT</code> with <code>REQUEST\_QUERY=APPLICATION\_START</code> when displaying the WorkflowGen menus and banners</li></ul>                                                                                                                                                                                                                                                                                                                                                                                   |
| `REQUEST_QUERY`     | To be used with `QUERY=CONTEXT` to  control the portal mode when starting an action. In this case, specify `APPLICATION_START`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `NO_REDIR`          | Ensure no redirection after form submit, e.g. `Y`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `ID_PROCESS_INST`   | The request ID that WorkflowGen will attempt to run, e.g. `192`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `ID_ACTIVITY_INST`  | The action ID that WorkflowGen will attempt to run, e.g. `2`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `BACKURL_SUBMIT`    | <p>The URL that the user will be returned to when submitting the completed form, e.g. <code><http://www.advantys.com></code></p><p></p><p>✏️ <strong>Notes:</strong> </p><ul><li>If no <code>BACKURL\_SUBMIT</code> is defined, WorkflowGen will use the selected redirection behavior from the Configuration Panel (e.g. return to home page, show follow-up form, etc.).</li><li>As of version 7.15.5, this parameter <strong>ONLY</strong> supports absolute URLs (starting with <code>http\://</code> or <code>https\://</code>), relative URLs (starting with <code>/</code>), or URLs defined in the <code>PortalRedirectAllowedHttpUrls</code> configuration parameter (e.g. <code>value='blank.htm, myPage.htm'</code>)</li></ul> |
| `BACKTARGET_SUBMIT` | <p>Name of the frame or iFrame to show the redirect page result as defined in the <code>BACKURL\_SUBMIT</code> parameter after the webform action is submitted</p><p></p><p>By default, it uses the <code>parent</code> frame. For example, to show the page in the current frame, you would specify <code>this</code> like so: <code>BACKTARGET\_SUBMIT=this</code><br><br>✏️ <strong>Note:</strong> To be used with and requires <code>BACKURL\_SUBMIT</code> only. </p>                                                                                                                                                                                                                                                                |

### Without the WorkflowGen portal

* WorkflowGen menus and banners are hidden.

To launch an action (second) directly from a link or URL, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=APPLICATION_START&ID_PROCESS_INST=192&ID_ACTIVITY_INST=2&BACKURL_SUBMIT=http://www.advantys.com
```

### Within the WorkflowGen portal

* WorkflowGen menus and banners are visible.

To launch an action (second) directly from a link or URL with visible menus, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=CONTEXT&REQUEST_QUERY=APPLICATION_START&NO_REDIR=Y&ID_PROCESS_INST=192&ID_ACTIVITY_INST=2
```

## Display a request follow-up form

* This displays the request follow-up form.<br>
* Participant security is enforced.

### Parameters

The parameters the URL uses are as follows:

| **Parameter**     | **Description**                                                                                                                                              |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `YOURSITE`        | The site where WorkflowGen is installed.                                                                                                                     |
| `QUERY`           | The task WorkflowGen will attempt to run, e.g. `PROCESS_INSTANCE_FORM`                                                                                       |
| `ID_PROCESS_INST` | The request ID that WorkflowGen will attempt to show, e.g. `192`                                                                                             |
| `SUPERUSER`       | <p>The security mode for accessing the follow-up form.</p><p></p><p>Set to <code>Y</code> to show the request follow-up form in manager/supervisor mode.</p> |

### Without the WorkflowGen portal

* WorkflowGen menus and banners are hidden.

To display a request follow-up form directly from a link or URL, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=PROCESS_INSTANCE_FORM&ID_PROCESS_INST=192
```

### Within the WorkflowGen portal

* WorkflowGen menus and banners are visible.

To display a request follow-up form directly from a link or URL with visible menus, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=CONTEXT&REQUEST_QUERY=PROCESS_INSTANCE_FORM&ID_PROCESS_INST=192
```

## Display a graphical follow-up form without the WorkflowGen portal

* This displays the graphical follow-up form disconnected from the WorkflowGen User Portal.<br>
* Participant security is enforced.<br>
* WorkflowGen menus and banner are hidden.<br>
* Drill-down to activities is disabled.

### Parameters

The parameters the URL uses are as follows:

| **Parameter**     | **Description**                                                            |
| ----------------- | -------------------------------------------------------------------------- |
| `YOURSITE`        | The site where WorkflowGen is installed                                    |
| `QUERY`           | The task WorkflowGen will attempt to run, e.g. `WFCANVAS_PROCESS_INSTANCE` |
| `ID_PROCESS_INST` | The request ID that WorkflowGen will attempt to show, e.g. `192`           |

To display the disconnected graphical follow-up form, use the example below:

```
http://YOURSITE/wfgen/show.aspx?QUERY=WFCANVAS_PROCESS_INSTANCE&ID_PROCESS_INST=192
```

## Download file data of a specific request or action using a WorkflowGen URL

The following examples show how to download file data from specific requests or actions using WorkflowGen URLs.

#### 📌 Download the latest form archive of request #192

```
http://YOURSITE/wfgen/show.aspx?QUERY=DOWNLOAD&DATA_NAME=FORM_ARCHIVE&ID_PROCESS_INST=192
```

#### 📌 Download the form archive of the first action of request #192

```
http://YOURSITE/wfgen/show.aspx?QUERY=DOWNLOAD&DATA_NAME=FORM_ARCHIVE&ID_PROCESS_INST=192&ID_ACTIVITY_INST=1
```

#### 📌 Download the form archive of the second action of request #192

```
http://YOURSITE/wfgen/show.aspx?QUERY=DOWNLOAD&DATA_NAME=FORM_ARCHIVE&ID_PROCESS_INST=192&ID_ACTIVITY_INST=2
```

## Display the User Portal inside another website

By using an iFrame you can embed the WorkflowGen User Portal inside another website. In this case, you have to define the URL of the "host" application in the Configuration Panel.

### Settings

![](https://content.gitbook.com/content/yo6RSViSZCOwvW4dWxPR/blobs/WNgpTbDyF1c8RpZI8MiN/portal-url-host.png)

## Possible errors

| **Error**                                                    | **Description**                                                                                           |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| `Invalid request: Process NAME or ID is required`            | The name or the identifier of the process (`ID_PROCESS` or `PROCESS` parameter) was not found.            |
| `DbConnect`                                                  | The database is not available.                                                                            |
| `GetUserInfos`                                               | Unable to retrieve the information about the user specified by the `REQUESTER_USERNAME` parameter.        |
| `Invalid user: User not found`                               | The username passed through the `REQUESTER_USERNAME` parameter does not correspond to a WorkflowGen user. |
| `Incorrect request: The request cannot be found`             | The specified process was not found or its status does not allow the system to instantiate it.            |
| `Incorrect request: The action cannot be found`              | The specified action was not found of its status does not allow the system to instantiate it.             |
| `This process cannot be launched by an external application` | The process was not declared as a public sub-process.                                                     |
| `Security: You are not authorized to launch this request`    | The specified requester is not associated to the requester participant of the process.                    |
| `CONTEXT Invalid XML`                                        | The XML content is not a valid XML string.                                                                |
| `CONTEXT Invalid recordset`                                  | The XML content does not represent a valid ADODB recordset object.                                        |
