Script Task Types
The IScriptTaskType instances define where a script task is executed in the DaVinci Configurator. The types also define the arguments
passed to the script task execution and what return type an execution has.
Every script task needs an IScriptTaskType. The type is set during creation of the script tasks.
Interfaces
All task types implement the interface IScriptTaskType. The following figure show the type and the defined sub types:
Available Types
The class IScriptTaskTypeApi defines all available IScriptTaskTypes in the DaVinci Configurator. All task types start with the prefix DV_.
None at parameters and return types mean, that any arguments could be passed and return to or from the task. Normally it will be nothing. The arguments are used,
when the task is called in unit tests for example.
ScriptTaskType input parameters can get accessed via script by adding them to the code block e.g. code{ List<Object> inputParameter -> inputParameter }
Application
The typeDV_APPLICATION is for application wide script tasks. A task could create/open/close/update projects. Use this type, if you need
full control over the project handling, or you want to handle multiple project at once.
| Name | Application |
|---|---|
| Code identifier | DV_APPLICATION |
| Task type interface | IApplicationScriptTaskType |
| Parameters | None |
| Return type | None |
| Execution | Standalone |
Project
The typeDV_PROJECT is for project script tasks. A task could access the currently loaded project. Manipulate the data, generate and save
the project. This is the default type, if no other type is specified.
| Name | Project |
|---|---|
| Code identifier | DV_PROJECT |
| Task type interface | IProjectScriptTaskType |
| Parameters | None |
| Return type | None |
| Execution | Standalone |
Module activation
The typeDV_ON_MODULE_ACTIVATION allows the script to hook any Module Activation in a loaded project. Every
DV_ON_MODULE_ACTIVATION task is automatically executed, when an "Activate Module" operation is executed. The script task is called after the module was
created.
| Name | Module activation |
|---|---|
| Code identifier | DV_ON_MODULE_ACTIVATION |
| Task type interface | IProjectScriptTaskType |
| Parameters | MIModuleConfiguration moduleConfiguration |
| Return type | Void |
| Execution | Automatically during module activation |
Module deactivation
The typeDV_ON_MODULE_DEACTIVATION allows the script to hook any Module Deactivation in a loaded project. Every
DV_ON_MODULE_DEACTIVATION task is automatically executed, when an "Deactivate Module" operation is executed. The script task is called before the module
is deleted.
| Name | Module deactivation |
|---|---|
| Code identifier | DV_ON_MODULE_DEACTIVATION |
| Task type interface | IProjectScriptTaskType |
| Parameters | MIModuleConfiguration moduleConfiguration |
| Return type | Void |
| Execution | Automatically during module deactivation |
Generation Step
The typeDV_GENERATION_STEP defines that the script task is executable as a
GenerationStep during generation. The user has to explicitly create an GenerationStep in the Project Settings Editor, which references the script task.
| Name | Generation Step |
|---|---|
| Code identifier | DV_GENERATION_STEP |
| Task type interface | IProjectScriptTaskType |
| Parameters | EGenerationPhaseType phase |
EGenerationProcessType processType |
|
IValidationResultSink resultSink |
|
| Return type | Void |
| Execution | Selected as GenerationStep in GenerationProcess |
Generation Process Start
The typeDV_ON_GENERATION_START defines that the script task is automatically executed when the generation is started.
| Name | Generation Process Start |
|---|---|
| Task type interface | IProjectScriptTaskType |
| Code identifier | DV_ON_GENERATION_START |
| Parameters | List<EGenerationPhaseType> generationPhases |
List<IGenerator> executedGenerators |
|
| Return type | Void |
| Execution | Automatically before GenerationProcess |
Generation Process End
The typeDV_ON_GENERATION_END defines that the script task is automatically executed when the generation has finished.
| Name | Generation Process End |
|---|---|
| Code identifier | DV_ON_GENERATION_END |
| Task type interface | IProjectScriptTaskType |
| Parameters | EGenerationProcessResult processResult |
List<IGenerator> executedGenerators |
|
| Return type | Void |
| Execution | Automatically after GenerationProcess |