How to use the script block in the workflow and run it from code ?
I want to create a workflow on startup, run a script to retrieve a value from a table in my database. When I check my workflow, an error occurs.
script:
xxx_ID: =: xxx_ID;
I want to use this value in one of workflow tasks.
Hi Alexandre,
1 – I want to link the WSWORKFLOWINSTANCE table, to another
table XXX (primary key XXX_ID) of my database<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
For this, I added a foreign key in the
table WSWORKFLOWINSTANCE.<o:p></o:p>
I want to display all tasks in
progress for a XXX_ID.<o:p></o:p>
2 – In
my workflow, I want to assign a value in the fields
XXX_ID through a
script in the workflow<o:p></o:p>
Script block :
xxx_ID: =: xxx_ID;<o:p></o:p>
I get an
error, which is:<o:p></o:p>
« Error while compiling script block. Syntax error. »<o:p></o:p>
Another question,<o:p></o:p>
how to update variables in the workflow, by
the code and not by the editor?<o:p></o:p>
Thanks<o:p></o:p>
Finally, I used the variables of the workflow to update the fields
var
wfi : TWorkflowInstance;
wvar: TWorkflowVariable;
begin
wvar := wfi.Diagram.Variables.FindByName('OrderNo');
if Assigned(wvar) then
wvar.Value := AOrderNo;
end;
Hi Alexandre,