Business process setup guide (BPMS)
PDF
This documentation is valid for Creatio version 7.9.0. We recommend using the newest version of Creatio documentation.

[Script task] process element

The [Script-task] process element is a system action that executes the C# code and provides its interaction with other elements of the business-process. Use this element to implement logic that the standard process elements cannot provide.

To edit the script code, double-click the diagram. Element setup page will open, where you can enter and edit the script code (Fig. 37).

Fig. 37 Editing tab of the script task code

chapter_process_designer_script_task_code.png 

btn_script_task_bigger_window.png – expand the script code window.

btn_script_task_window_small.png – collapse the script code window.

btn_com_show_hide_outline.png – search text in the script code.

btn_com_show_hide_hidden_characters.png – show the hidden symbols (spaces, tabulations, etc.) in the text code.

Note

Bpm'online enables you to execute processes without publishing them. However, the use of methods and [Script-task] elements requires the schema publication. Learn more about calling process methods in a separate article.

The [Script-task] element and the process method contain an additional cheсkbox [For an interpreted process], which indicates that the element can be executed in an interpreted environment (Fig. 38). By default, this checkbox is selected. For such elements and methods a special code is generated that provides an interface to access the element and process parameters and values.

Fig. 38 The [For an interpreted process] checkbox in the [Script-task] element settings

chapter_process_designer_script_task_sign.png 

Interpreted process schemas

For the [Script-task] elements and methods that have the [For an interpreted process] checkbox selected, the wrapper class is generated that contains the initialization and declaration of methods. This wrapper enables you to access the process values (Fig. 39).

The Get method returns the value of an item or process.

Method signature:

Get<T>(string path)

where:

T — parameter value type.

path — a string that specifies the path to a parameter or property. The path is built according to these rules:

“parameter name”

“property name”

“element name.parameter name”

“element name.property name”

The Set method sets the value of an item or process.

Method signature:

Set(string path, T value)

where:

value — the specified value.

path — a string that specifies the path to a parameter or property. The path is built according to the rules described above for the Get method:

Fig. 39 The [Script-task] element body that contains the call to the interpreted process parameter

chapter_process_designer_script_task_integrating_code.png 

Next

[Connect process to object] process element

[User task] process element

See also

An example of using the built-in object process. How to add auto-numbering to the edit page field

How to run a process from client module

Did you find this information useful?

How can we improve it?