Workflow Scripts
Workflow scripts can be entered:
- in the Procedures book on the Editor tab, by clicking a specific step and adding a script on the Action tab. The script is run after the event entered in the Action field has been performed, if this event occurs in the process or in a process step,
- in the Workflow products book when entering Registered points.
The WkfCreateProcess.pas script can be run in bulk on selected records of the attached document.
Workflow scripts can be found in the Script catalogue.
Approving a Workflow Step from Email
The function allows approval of workflow steps that do not require user input. The user can approve or refuse steps directly from the email or open them as an html link.

Picture: Email preview of a workflow step
Description of fields:
I agree |
The user approves the step directly from the email |
I reject |
The user refuses the step directly from the email |
Open |
The user opens the workflow step in the default web browser of the given system. If the step parameters are set as editable, the user can change their values or the comment there. |

Picture: Preview of a workflow step in a web browser
Setup procedure:
1. An AS must be installed and also configured for the task scheduler, i.e. the parameter SCHEDULESERVICE=1 in the AS ini file, and K2 API (web services server) must be up and running.
2. In IS K2, run the WkfEmailConfiguration.pas script and set its values.
Picture: Step configuration by email
Description of fields:
URL address of the web services server |
The server on which K2 API is installed |
Type of el. address for email |
The type of el. address to be used from the Contact person for sending an email to the workflow user |
3. The user through which the AS communicates with IS K2 must have a correctly set up and configured mail account in IS K2 in the mail module.
4. IS K2 users must be correctly paired with a Contact person.
5. Each Contact person linked to a user must have the login credentials for K2 API entered on page E. The record value number in the "Web" field must be specified in the AS INI file as the "AS3IO" parameter.

Picture: Contact person login credentials for K2 API
6. In IS K2, in the workflow procedure book, the WKFSheduleEmailTask.pas script (this script, including its parameters, is described in the script catalogue) must be included on the specific procedure step that does not require user input and can be approved by email. The procedure variables on this step are generated in the order in which they are entered on the step and with the properties specified for them.
7. Approving a step by email is supplemented by the selection of subsequent steps, which is set in the procedure with the SelStep parameter. In the email, the user can choose with which steps the process will continue.
Functionality for editing the template for approving a step by email:
For workflow, the template can be entered in the Email templates book as follows:
- as the new "EmailTemplate" parameter of the WkfScheduleEmailTask.pas script, where the template abbreviation is entered, e.g. the value "AgreeStepWorkflow"
- "Step configuration by email" has a new property "Template for email", std. script WkfEmailConfiguration.PAS
- if no template is set anywhere, the email content is generated by the script
Picture: Script entry
Picture: Step configuration by email