Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Workflow Studio
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; 
Then you declare your global initialization method PrepareScripter. The Sender parameter is the scripter component, so you just need to typecast it to a generic TwfCustomScripter class. Here is an example:
Procedure TMyDataModule.PrepareScripter(Sender: Tobject); 
begin
  With TwfCustomScripter(Sender) do
  begin
    AddComponent(Form1);
  end;
end;