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:

IScriptTaskType interfaces
Figure 1. IScriptTaskType interfaces

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 Types

Application

The type DV_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 Types

Project

The type DV_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 type DV_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 type DV_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 Types

Generation Step

The type DV_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 type DV_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 type DV_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