Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>



Registering components and methods in workflow scripting system
The Workflow Studio manual describes how to register new components, methods, classes and properties to a scripter component by using methods like DefineClass, DefineProp, etc.. However, Workflow Studio creates a new scripter component instance for each script block that is used in a workflow instance. Due to that, you must use OnGlobalScripterCreate event to make sure you initialize all scripter components in the system. The following steps show how to do that. The OnGlobalScripterCreate is a global variable of type TNotifyEvent declared in Wf.Script.pas unit. First of all, you need to set that global variable to a method in your application:
{PrepareScripter is a method in any of your existing and instantiated classes} OnGlobalScripterCreate := PrepareScripter;
Procedure TMyDataModule.PrepareScripter(Sender: Tobject); begin With TwfCustomScripter(Sender) do begin AddComponent(Form1); end; end;