Book Contents

Book Index

My office

Book Contents

Book Index

Workflow

User check

Process number: WKF003

Script Id. number: FWKF010

File: EntryCheckUser.PAS

Script description: The "EntryCheckUser" script is entered on the "input" event of the step (page 2 of the Versioned procedures book, select the step, Actions tab). This means that it is evaluated when the step is created in the process. The script ensures that the step is created for all contact persons entered as assignees of the step EXCEPT the person who was the assignee of the previous step.

Address in the tree:

Script parameters:

No parameters.

Product over sales order

Process number: WKF003

Script Id. number: FWKF006

File: Wkf_Zak_Prod.PAS

Script description: The script performs actions on products.

Address in the tree:

Script parameters:

Action

A parameter that performs actions with products. E.g. when we approve a step, the script confirms or unconfirms the product (invoice, sales order...).

Attach document to product

Process number: WKF003

Script Id. number: FWKF009

File: LinkDocToProd.PAS

Script description: The script makes it possible to attach documents of the "DKHL" type to K2 products (invoices, advances, delivery notes) at a certain event of a step in the process. Both the products and the documents must be attached to the process.

E.g.: A scanned invoice delivered by post (a document of the "DKHL" type) is attached to the Invoice in in the Invoices in book, on its page 9.

Address in the tree:

Script parameters:

No parameters.

The script is entered on page 2 of the Versioned procedures book, on the Events tab in the Script, field, after selecting the step. It is entered together with the event at which it is to be run (Event field).

Then, in the process, when an operation is performed on this step that triggers the selected event, the Assign documents to products form appears.

pic_2019

Picture: Assign documents to products form

The upper part of the form lists all products attached to the process; the lower part of the form lists all documents of the DKHL type that are attached to the process and that will be assigned to the K2 products listed in the upper part of the form.

The Previous and Next buttons are used to browse between the individual products in the upper part of the form. The product to which we are currently attaching a document is marked with an asterisk.

In the lower part of the form, we mark with an asterisk the documents that we want to assign to the product marked with an asterisk in the upper part of the form. We can mark any number of documents. However, we do not have to mark any if we do not want to assign a document to the product.

If there is one product and one or more documents in the form, these documents are marked automatically.

The OK button then confirms the assignment of documents, the documents are assigned to page 9 of the K2 products (invoices, advances, bank documents...) and the K2 products are assigned to page 2 of the documents.

If there is no assigned product or document in the process, a message appears notifying the user of this fact, and the user can either continue processing the step or interrupt the processing and assign documents and products to the process.

Note: When using the script, multiple contact persons must not be designated for processing the step. For a step that has this script entered, the selection method for assignees must be set only to "One of them" or "User one of them".

Step status

Process number: WKF003

Script Id. number: FWKF004

File: CheckStep.PAS

Script description: The script is entered on a workflow product at a registered point of the product. It checks the status of the process step that is assigned to the product that has this script entered. (E.g. the script ensures that an invoice in cannot be confirmed if the "Invoice approval" step is not approved.)

Address in the tree:

Script parameters:

Step_Name

The name of the step to be checked is entered.

ExistProcess - 0

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

Input with user selection, filling the variable

Process number: WKF003

Script Id. number: FWKF003

File: EntryUserVar.PAS

Script description: The script is entered when a step is created, at the Input and Output event; it selects contact persons according to a variable. The Variable name is entered as a parameter.

Address in the tree:

Script parameters:

Add_User_G

A Role is entered with a list of contact persons who can work with the process and see the process data without being included in any Role in the process. They can enter a Comment into the process.

Beg_Stmt

Assigns a certain value to the variable; it runs before the form is displayed, if we want to calculate something at the beginning of work with the step.

CostCentreVar

We can influence the selection of contact persons by cost centre. E.g. {CostCentreVar}[STR];[STR2]. The name of the variable for the cost centre is entered in square brackets (there can be more variables, separated by a semicolon).

End_Stmt

Assigns a certain value to the variable; it runs after the step is processed, if we want to calculate something at the end of work with the step.

Exclude_Users

Deletes contact persons from the role so that they do not have access to the process data.

Fill_Var

Fills the variable with a calculation (corresponds to the Calcvar parameter, see Workflow parameters). E.g.

{Fill_Var}[UZIVATEL_O]:=%USER% fills the variable with the contact person linked to the current user.

User_Var

We can influence the selection of contact persons for whom the step will be created. E.g. {USER_VAR}[ZADAVATEL]. The name of the variable in which we expect the number of the contact person for whom the step is to be created is entered in square brackets.

Create process

Process number: WKF003

Script Id. number: FWKF005

File: CreateProc.PAS

Script description: The script is entered in the Workflow products book, in the registered points of the product. E.g. When a new sales order is created, a process is created for the sales order.

Address in the tree:

Script parameters:

Proc_Name

We give the process a name (e.g. Sales order 10/2010).

Name_Fld

We specify that we want to display the sales order number. This number can then be used, for example, in the name of the process that will be created by the "Proc_Name" parameter.

Ver_Abbr

We enter the Abbreviation of the procedure header from which the process is to be created at the registered point.

Book Contents

Book Index

Create process over document

Process number: WKF003

Script Id. number: FWKF012

File: WkfCreateProcess.PAS

Script description: The script is used to create a process over a document.

Address in the tree:

Script parameters:

ProcessName

Process name.

DiagramAbbr

Abbreviation of the procedure according to which the process is created.

BooksDoc

List of document books (abbreviations) separated by a semicolon for which the process is to be created (if BookDoc="", there is no restriction.)

OnlyOneProcess

1 - Ensures that only one process exists for the given document.

JoinExternalDocument - 1

1 - Attaches the documents of the document to the process.

0 - Does not attach the documents of the document to the process.

ShowFormDetail

Display the work step detail after the process is created.

LiablePerson

Person responsible for the process; this is the number of the contact person.

DocumentTypeList

List of types (abbreviations) of the attached document separated by a semicolon. (If DokumentTypeList="", all documents of the document are attached.) Processed if JoinExternalDocument = True.

ConfirmedDocument - 0

0 - If the document is confirmed, a new process will not be created.

1 - The attached document can be confirmed.

JoinDocument - 1

1 - The created process is linked to the document.

0 - The created process is not linked to the document.

SaveProcessBeforeProcessing

The new process is saved without processing the steps, and then the process goes into editing, where the steps are processed according to the procedure.

QuestionOnStart - 0

1 - When a new process is created, a message is displayed asking whether the process should be created.

OneProcessForDocumentRecords - 0

1 - One process is created for the selected records of the document

Book Contents

Book Index

Creating a process from a receipt

Process number: WKF004

Script Id. number: FWKF014

File: CreateReceiptWorkflow.pas

Script description: The script is used to create a process from a receipt

Address in the tree:

Script parameters:

CommentAdditional

Type of comment that is written to the created document. This comment will contain the value of the FieldAdditional parameter.

CommentNote

Type of comment that is written to the created document. This comment will contain the value of the FieldNote parameter.

DiagramId

ID of the WKF procedure.

DocumentType

Document configuration type. It must be of the Document server type.

FieldAdditional

Variable in the WKF process that will be filled into the FieldAdditional field.

FieldCostCentre

Variable in the WKF process that will be filled into the FieldCostCentre field.

FieldEmployee

Variable in the WKF process that will be filled into the FieldEmployee field.

FieldNote

Variable in the WKF process that will be filled into the FieldNote field.

Create process activity

Process number: WKF003

Script Id. number: FWKF010

File: ActivityCreate.PAS

Script description: The "ActivityCreate" script makes it possible to create an activity during the process. In the procedure, we set that at a user event on a step (e.g. when the step is approved), a form for creating a new activity is displayed - page 1 of the activity. If an opportunity is attached to the process, the activity form is pre-filled with data from this opportunity and the activity is attached to it.

Address in the tree:

Script parameters:

No parameters.

WKF email

Process number: WKF003

Script Id. number: FWKF007

File: WKF_Email.PAS

Script description: The script sends an e-mail with certain information to the e-mail address entered in the script parameter. The necessary information must be set in the account in the Mail module.

Address in the tree:

[Workflow] [Workflow administration] [Procedures]

Script parameters:

EAdress

Creates the e-mail text; the subject contains the procedure Abbreviation , the process Id and the process Name . The body contains the ID and Name of the process and all process Comments .

E.g.: {EAddress}k2.demo@k2atmitec.cz

Workflow Step form

Process number: WKF003

Script Id. number: FWKF008

File: WKF_Step.PAS

Script description: The script creates a form for steps and enables work with steps. It replaces the functionality of the step approval form with the functionality described in Parameters.

Address in the tree:

Script parameters:

Ascend - 0

Sorting of the step display in ascending order by date of creation.

Beg_Stmt

Assigns a value to the variable; calculates a certain variable when the Work step form is displayed.

End_Stmt

Assigns a value to the variable; calculates a certain variable after the Work step. form is closed.

Link_Doc_Typ

We specify which document type is to be created.

Proc_Var

Option to enter the value of a certain variable while the process is running (e.g. the invoice amount, the cost centre designation), displays the process variables.

Prod_Id

Adds a product to the step.

Show_Vars

Determines whether variables will be displayed on the form.

Step_Var

Option to enter the value of a certain variable while the process is running (e.g. the invoice amount, the cost centre designation), displays the step variables.

Book Contents

Book Index

Approval/rejection of a workflow step from e-mail

Process number: Wkf005

Script Id. number: FWKF009

File: WkfScheduleEmailTask.pas

Script description: The script makes it possible to send an e-mail with a uniquely generated HTTP link with parameters, through which wkf steps can be approved or rejected.

Address in the tree:

Settings:

See script Example 127 - generating HTML for K2 web services.

Book Contents

Book Index

Service script for reducing Wkf roles

Process number:

Script Id. number: FWKF013

File: ReductionRoleWkf.PAS

Script description: The script is intended for reducing roles that were created by conversion from K2 point to K2 move and contain only one person. It is run over the Roles. code list. The script finds roles that have the word "Konverze" in their name and whose abbreviation number is also in the name. It groups these roles by person, keeps only one role for each person (fills the person's name into the role name), deletes the other roles and corrects their references in the workflow.

Address in the tree:

Script parameters:

No parameters.