Book Contents

Book Index

Workflow scripts and parameters

Book Contents

Book Index

Workflow Scripts

Workflow scripts can be entered:

Book Contents

Book Index

Entry with choice of user, fill in of variable

Process No.: WKF003

Script Id: FWKF003

File: EntryUserVar.PAS

Script description: Script is entered when step is created, at Entry and Exit event, contact persons are chosen based on variable. As a parameter name of variable is entered.

Address in the tree structure:

Script parameters:

Add_User_G

Role with list of contact persons is entered. These contact persons are allowed to work with process and also see data of the process, without being included in any Role of the process. They are allowed to enter comment to the process.

Beg_Stmt

Certain value is being entered to variable field, it runs before form is displayed, if we want to calculate something at the beginning of work with step.

CostCentreVar

We can influence choice of contact persons according to cost centre. E.g. {CostCentreVar}[STR];[STR2]. Name of variable for cost centre is entered into square brackets (it can have more variables separated by semicolon).

End_Stmt

Certain value is being entered to variable field, it runs after step is completed, if we want to calculate something at the end of work with step.

Exclude_Users

It deletes contact persons from role so that they cannot access data in the process.

Fill_Var

It fills variable with calculation (it's equal to parameter Calcvar, see Workflow Parameters). E.g.

{Fill_Var}[USER_O]:=%USER% fills contact person connected with current user to variable.

User_Var

We can influence choice of contact persons for which step will be created. Example {USER_VAR}[SUBMITTER]. Name of variable at which we expect number of contact person, for whose the step should be created, is entered into square brackets.

Book Contents

Book Index

Status of step

Process No.: WKF003

Script Id: FWKF004

File: CheckStep.PAS

Script description: Script is entered at registered product point in Workflow product. It provides status of the step which is assigned to product that includes the script. (Script e.g. ensures that received invoice cannot be confirmed if step "Invoice approval” is not confirmed).

Address in the tree structure:

Script parameters:

Step_Name

Name of the step which should be checked is entered.

ExistProcess - 0

0 - script is always evaluated; 1 - script will only be evaluated if product (invoice, sales order...) will contain process on page 9.

Book Contents

Book Index

Create process

Process No.: WKF003

Script Id: FWKF005

File: CreateProc.PAS

Script description: Script is entered at registered product points in Workflow Products book. Example Process for sales order is created when new sales order is established.

Address in the tree structure:

Script parameters:

Proc_Name

We assign a name to the process (e.g. Sales Order 10/2010).

Name_Fld

We request to show Sales Order number. This number can then be e.g. filled to the name of process which will be created by "Proc_Name” parameter.

Ver_Abbr

We add Abbreviation of procedure header from which at registered point process should be created.

Book Contents

Book Index

Product linked to Sales Order

Process No.: WKF003

Script Id: FWKF006

File: Wkf_Zak_Prod.PAS

Script description: Script runs actions above products.

Address in the tree structure:

Script parameters:

Action

Parameter which does actions with products. Example When step is approved script confirms or does undo confirmation of product (invoice, sales order...).

Book Contents

Book Index

WKF email

Process No.: WKF003

Script Id: FWKF007

File: WKF_Email.PAS

Script description: Script sends email with certain information to the email address set up in the script parameter. It's necessary to have needed information set up in the Mail module.

Address in the tree structure:

[Workflow] [Workflow Administration] [Procedures]

Script parameters:

EAdress

It creates email text with Procedure Abbreviation, Process ID and Process Name in email subject. Process ID and Name as well as  all process Comments are in the email body.

Example: {EAddress}k2.demo@k2atmitec.cz

Book Contents

Book Index

Workflow Step form

Process No.: WKF003

Script Id: FWKF008

File: WKF_Step.PAS

Script description: Script creates form for steps and allows working with steps. It substitutes step approval form functionality with functionality described by Parameters.

Address in the tree structure:

Script parameters:

Ascend - 0

Step view sorting in ascending order, according to date of creation.

Beg_Stmt

Inserts value to variable, certain variable is calculated when Work Step form is displayed.

End_Stmt

Inserts value to variable, certain variable is calculated after form Work Step is finished.

Link_Doc_Typ

We decide which document type should be created.

Proc_Var

There is an option to enter certain variable value (e.g. Invoice value, cost centre number) during process run, it displays process variables.

Prod_Id

Product is added to step.

Show_Vars

It decides if variables will be displayed in the form.

Step_Var

There is an option to enter certain variable value (e.g. Invoice value, cost centre number) during process run, it displays process variables.

Book Contents

Book Index

Attach document to product

Process No.: WKF003

Script Id: FWKF009

File: LinkDocToProd.PAS

Script description: Script which allows to attach "DKHL” type documents to K2 products (invoices, advance payments, delivery lists), at the specific action step in process. Products and also documents must be added to process.

Example: Scanned invoice delivered by post ("DKHL” type document) will be attached to Received Invoice in Received Invoices book, specifically at the page 9.

Address in the tree structure:

Script parameters:

Without parameters.

Script is entered on page 2 of Versioned Procedures book, tab Events, field Script, after step is marked. It’s entered together with event at which it is supposed to run (field Event).

Form Attach documents to products is displayed in process when operation, which initiates chosen event, is performed at this step.

pic_2019

Picture: Form Attach documents to products

All products which are linked to process are shown in upper part of the form. At the bottom of the form all "DKHL” type documents are shown. These will be linked to process and will be added to K2 products shown in upper part of the form.

Use Previous and Next buttons to switch among products in upper part of the form. Product to which the document is being attached is marked with star.

We mark with star documents in bottom part of the form to attach them to products marked with star in upper part of the form. We can mark as many documents as we want. It’s not necessary to mark any if we don't want to attach any document to product.

If in a form one product and one or more documents exist, these documents will be marked automatically.

By pressing OK button attaching of the documents will be confirmed and documents will be added to page 9 of K2 products (invoices, advance payments, bank documents...).  K2 products will be added to documents page 2.

If assigned product or document don’t exist in process, message will pop up to alert the user. User can either continue further in the step or he/she can stop and attach documents and products to the process.

Note: When script is used it’s not allowed to dedicate more contact persons to process the step. For step, which has defined the script, selection method "One of them” or "User way one of them” must be set up for user.

Book Contents

Book Index

Process activity creation

Process No.: WKF003

Script Id: FWKF010

File: ActivityCreate.PAS

Script description: Script "ActivityCreate” allows to create activity in the middle of process. In the procedure we set up that form for new activity creation - page 1 of the activity, will be displayed at the user's event step (e.g. when step is being approved). If opportunity is assigned to the process, data from the opportunity will be autofilled to activity form and activity will be attached to it.

Address in the tree structure:

Script parameters:

Without parameters.

Book Contents

Book Index

Users’ check

Process No.: WKF003

Script Id: FWKF010

File: EntryCheckUser.PAS

Script description: Script "EntryCheckUser” is entered at the "entry” action of the step (page 2 of Versioned Procedures book, step colour marking, Action tab). This means that it is evaluated when step in process is being created. Script is responsible for step creation for all contact persons defined as step assignees EXCEPT person which was assignee of previous step.

Address in the tree structure:

Script parameters:

Without parameters.

Book Contents

Book Index

Workflow step approval from email

Function allows approval of workflow work steps which don't require user access. User can approve or reject steps directly from email or open them as html link.

pic_3778

Picture: Email with workflow step

Description of Fields:

Approve

User approves step directly from email

Reject

User rejects step directly from email

Open

User opens workflow step in default web browser for given system. If step parameters are defined as editable then here we can change their values or their comments.

pic_3779

Picture: Workflow step in web browser

Settings procedure:

1. AS configured also for task planning, must be installed i.e. parameter in ini file AS SCHEDULESERVICE=1 and functioning SWS (web service server).

2. Launch WkfEmailConfiguration.pas script in IS K2 and set up its values.

pic_3776

Picture Step configuration via email

Description of Fields:

URL address of web services server

Server where SWS is installed,

Type of electronic address for e-mail.

Type of electronic address which should be used from Contact Persons for sending email to workflow user.

3. User through which AS and IS K2 communicate together, should have mail account correctly set and configured in IS K2 Mail module.

4. IS K2 users should be correctly paired with Contact person.

5. Every contact person, connected to user, must have login details for SWS shown on page E. Number of record value in "Web” field must be set in AS INI file as "AS3IO" parameter.

pic_3777

Picture: Login details of contact person for SWS

6. Script WKFSheduleEmailTask.pas (described together with its parameters in script catalogue) must be included in Workflow procedure book of IS K2 at specific procedure step which doesn’t require user login and can be approved via email. Procedure variables, which are at this step, are generated in the same order they were entered in step and with properties defined for them.

7. Option Selstep has been added to step approval via email. User can now choose another user in email to which he/she will send the next step. Users’ selection at steps is defined with procedure.

Book Contents

Book Index

Workflow Parameters

Workflow parameters are entered in Versioned Procedures book on page 2 in the Events tab. They are always added to the event for which user wants to evaluate/enter parameter.

Parameter is evaluated when user executes specified event in process step (or in process).

Book Contents

Book Index

Arrow evaluation

Parameter is set for arrow, i.e. after arrow is highlighted and it's used to decide if process run should continue via this arrow.

E.g. Process can go through different steps when invoice value is higher, when invoice cost centres are set differently, ...

For evaluation we can use:

pic_3120

Picture: Arrow parameters entry when variable value "Check" = "No”

pic_2045

Picture: Procedure "Task", arrow parameters entry when variable value "Check" = "Yes”

Example: There is procedure “Task”, see picture below, which contains variable "Check”. Variable values can be either “Yes” or “No”. It depends on the variable value which step will be created after “Task Solving”:

Set up of parameter and variable in procedure:

For the process to work this way there must be set up done after arrow is highlighted in Action tab to define conditions to “move through” the arrow:

pic_1066

Picture: Expression Entry form after parameter ArrowIf selection

Description of form fields:

nt

Logical expression “not“ (to negate expression shown in brackets).

ad

Logical expression “and“ (logical multiplication).

or

Logical expression “or“ (logical sum).

IF

Logical expression “if“ (it’s used to select value based on certain conditions).

"V

It's used to choose variable from Book of procedure variables. When pressing this button Definition of Variables book displays.

"P

It’s used to fill in field from assigned K2 product (from invoice, order...). Value of this field will be evaluated during process run. Aggregation function ("first”, "last”...), through which we determine way of variable evaluation if process contains more products of same type (e.g. more received invoices), is entered here:

Example: Process has assigned 3 received invoices. First invoice has nett value: 300 CZK, second 200 CZK and third 10 CZK.

  • "First” - field value from first appearance of the product is evaluated (from first entered invoice) - nett value 300 CZK is selected for evaluation.
  • "Last” - it’s evaluated from the last invoice - value 10 CZK is chosen for evaluation.
  • "Max” - maximum value from all is selected - value 300 CZK is chosen for evaluation.
  • "Min” - minimum value from all is selected - value 10 CZK is chosen for evaluation.
  • "Count” - number of all values is counted - number 3 is chosen for evaluation.
  • "Sum” - summary of all values - value 510 CZK is entered for evaluation.
  • "Avg” - average of all values - value 170 CZK is entered for evaluation.

Book Contents

Book Index

Process status

“ProcStatus“ parameter - Process Status:

Example: Process status is set to “Entered” at step Approval in the first step of the process, in the fourth step at event Approved, Process Status is changed to "Approved”.

Change set up of process status in procedure:

pic_1068

Picture: Value - book form after selecting "ProcStatus” parameter

Book Contents

Book Index

Document type

Parameter “DocType“ - Document Type allows user to insert document from his/her computer to process. This can be done with Insert Document button in step detail of Steps book (or possibly in For Processing book). This button becomes active by correct entry of parameter in procedure:

pic_1177

Picture: Form Types after selecting parameter “DocType“

Press button Insert Document in book For Processing / Steps.

pic_2877

Picture: Button Insert Document, list of document types available for inserting is displayed

Book Contents

Book Index

Insert product

“InsProd“ parameter - Insert Product allows step assignee to attach K2 system Products (invoice, bank statement, delivery note, ...) to process. This can be done with Insert Product button in step detail of Steps book (or possibly in  For Processing book). This button becomes active by correct entry of parameter in procedure:

pic_2878

Picture: Form Product - products inserting via “InsProd“ parameter

Press button Insert Product in book For Processing / Steps.

pic_1178

Picture: Work Step form after pressing Insert Product button

Book Contents

Book Index

Owner according to another step

“UserStep“ parameter - Owner according to Another Step is used at Entry event and according to owner of another step it chooses for which contact person step will be created.

Example: List of “Travel Order“ procedure steps is in Procedure Steps book. Person classified in role “CP_VYUCT“ received and processed step “Fill in of Authorization“, step "Business Travel Claim” should also be created for person with "CP_VYUCT” role. Therefore we should add parameter “UserStep“ in Entry Event of the step and in Value field we choose step “Fill in of Authorization“.

pic_1179

Picture: Procedure Steps - book form after selecting "UserStep” parameter

Book Contents

Book Index

Same owner

Parameter “SameUser“ - Same Owner is used at Entry event. Step owner which has already processed step earlier (rejected or approved) is chosen from contact persons listed in step Role.

Example: Five coordinators in company send contracts for signature to director. When signature is rejected by director, approval process will return back to the coordinator, which sent the contract to director.

Book Contents

Book Index

Selection of next steps

With parameter “SelStep“ - Selection of Next Steps we allow user at Exit Event (Step Approval or Rejection) to select from next process steps the step, which should be created. User can select also more of these steps.

Book Contents

Book Index

Calculation of variable value

By using “CalcVar“ parameter - Calculation of Variable Value, given value is at certain event entered to process variable.

Note: Meaning of buttons nt, ad, or, IF, "V, "P, see Fields Description in Editor, parameter „ArrowIf“.

Example 1: In picture below, value “6“ is set in process variable DNU, at event Approval of the step.

pic_1180

Picture: Expression Compilation form after “CalcVar“ parameter selection to enter its Value.

Example 2: {CALCVAR}[DATE_FROM]:=[DATE_FROM_PL] - selected event of the step or the process assigns actual variable value DATE_FROM_PL to variable DATE_FROM.

Example 3: {CALCVAR}[DATE_FROM]:=0 - zero date is assigned to variable DATE_FROM.

Example 4: {CALCVAR}[DATE_FROM]:=%12.12.2012 - date 12.12.2012 is assigned to variable DATE_FROM. (% sign should be added before date value).

Example 5: {CALCVAR}[STATUS]:='Default’ - text 'Defaults’ is assigned to variable STATUS. (text variable value must be entered with apostrophes).

Book Contents

Book Index

Variable set up

“SetVar“ parameter - Variable Set up allows step user to enter/change value of selected variable (e.g. invoice value, cost centre number, text entry...) during process run. According to this variable process can be further evaluated and managed. (e.g. according to cost centre entry we can define to what other people will process further lead to).

Book Contents

Book Index

Process Creation

“CreateProc“ parameter - by Process Creation entered at certain step Event we ensure that new process will be created at this event. Header of procedure, according to which process will be created, is selected at this parameter entry. Process will then run according to currently valid version of selected procedure header.

Book Contents

Book Index

Check of Variables

By parameter “Validation“ - Check of Variables we ensure check of variable value entered in process.

pic_1228

Picture: Expression Entry form after selection of “Validation“ parameter to enter its Value.

Example: In picture is with button "V set, that in process:

If we want to check date value in variable, we enter date in format: [DATE]>%12.12.2012. i.e. we enter % sign before date. With following entry we can ensure that there’ll be no zero value, i.e. 0.0.0000, in date variable: [DATUM]<=0.

Book Contents

Book Index

User for Work Step

Parameter “UserVar“ - User for Work Step allows us in process to create Step for contact person according to Variable value. Variable of parameter can be entered via Expression Entry form, which appears after “UserVar“ parameter is selected. Variable should be entered to Expression field via "V button and by choosing offered variable, possibly it can also be entered in hand by writing Identifier of variable in square brackets.

pic_1943

Picture: Expression Entry form after selection of “UserVar“ parameter to enter its Variables.

Variable should meet following conditions to ensure correct working of parameter:

Example: In picture above is via "V button set that step in process will be created for person, which is currently set in process in "USRGRP” variable value.

Book Contents

Book Index

Action at Product

Parameter “ProdAct“ - Action at Product allows to perform given action with product which will be assigned to process.

For example: Received invoice is confirmed when step is approved, received invoice is cancelled when step is rejected.

pic_1963

Picture: Form Action Entry at Product after selecting “ProdAct“ parameter

Product

Product header is chosen here. Specific product, which will then be assigned to process, will at given event either be confirmed or cancelled.

Action

Here we enter action type which should be performed at entered event together with product. We can do following actions with specific product assigned to specific process:

If product, which doesn’t meet conditions to take the action, will be assigned to process, K2 system doesn’t allow us to perform operation responsible for the action.

If product, at which given action has already been performed, is assigned to process, K2 system allows to perform the operation.

Book Contents

Book Index

Check of closure of all steps

Arrow parameter "AllStepsClosed” - Check of Closure of All Process Steps is responsible for steps convergence to one step “Unification” - which is generated when all process steps are finished. Steps “For Attention” are not taken into account.