Initiating a Workflow Anonymously¶
With this example, we create a new process that can be initiated anonymously and can be embedded into a website or other application.
Steps¶
Create a New Process¶
-
Create a new process with the "Anonymous Task" name from the folder menu and edit the process version to open process designer.
-
Click on âPoolâ to open the design of the pool.
-
Before designing the process diagram check the âIs Anonymously Accessible ?â box from the left sidebar to enable access to this pool to anonymous users.
Create Tasks¶
- In this example we create 2 tasks as following graph;
The process will be started with the âService Requestâ task and when completed workflow moves to the âService Handlingâ task to handle the related request.
Create Roles¶
-
Create a role with the âService Handlerâ name to define who is filling this role in the process.
-
When role a added designer automatically opens the role definition editor. Click on the â+â icon to add a new row and select a responsible person by clicking on the âAssigned Toâ column.
- Select the âService Handlingâ task from the process diagram and choose âService Handlerâ from the task options on the left side of the screen.
Create Form¶
- Click on âFormâ from process designer to open form designer.
- After the form designer is open click on the âAdd Newâ button and expand the âLayout Optionsâ and choose âRow Contentâ to append a new row layout content to the form.
- Select the row content and click again to âAdd Newâ expand âInput Controlsâ and choose âHtml Editorâ from the options.
- Because we are creating a new field designer will ask for the name of the field to be added to the form. Enter âRequestâ and click on the âOkâ button.
- After the field is appended, the form design should be looking like this;
You may add additional fields to form as many as you want. These fields are asked of the anonymous user while filling out the form.
Saving Process¶
- Click to âCloseâ button on top of the screen to close the designer and click on to âCommit Changesâ button to save your work.
- At this step, we have finalized the design of the process and we can test it.
Testing¶
- In the folder of the process we should see a new start point as the âService Requestâ option as follows;
At this stage, if we start a new instance of the âService Requestâ process it is started in test mode and all of the tasks will be assigned to the current user for easier testing.
Creating API Key¶
Anonymous access requires an API key to limit certain features that can be used by an anonymous user. To create an API key open the âEdit Domainâ from the âSystem Administrationâ menu.
- Open the âSecurityâ tab and then select the âAPI Keysâ sub-tab.
- Click on the âAdd Newâ menu to create a new API key, and enter the purpose of this API key for why this API key is needed. Click the âDoneâ button to close the editor.
-
Click on the âDetailsâ button to specify which features are can be used with this API key.
-
For anonymously accessed forms at least âloginâ and âprocess_initiateâ features must be enabled. Choose âEnabledâ for these features.
- Before closing copy the API key with a copy to the clipboard button with the red circle. We will need this API key later while embedding the form.
Info
Instead of using a single API key for all type of forms, creating a new one is recommended.
- Select the âSaveâ action from the top menu to save these changes.
Embedding Form to a WebSite¶
After the API key has been created we can embed the âService Requestâ step in a website.
- Create an empty html file with the following content;
1 2 3 4 5 6 |
|
- Navigate to the folder where the âService Requestâ process is saved, instead of clicking on the service request start step right click on it and choose âCopy Link Addressâ from the menu.
-
In html file content replace the IFrame src attribute with copied address and replace the â#' character with '?â and add generated API Key parameter to the end of the address in â&apiKey=âŚ..â format.
-
The final address should be like this;
1 2 3 4 5 6 |
|
- Save the html and now can open the html in the browser.
More details can be found on the Embedding Emakin page.