task table without data generated

I"m writing code using the example of section 7.3 of the manual and I do not get the desired results, by executing the following line "WorkFlow.WorkflowEngine.RunWorkflow (wfi)" on the table "WSTASKINSTANCE" does not generate any information and Table "WSWORKFLOWINSTANCE "is generated correctly.

allowed me to make some changes in the product demo to see if it was my application, and got the same results from my application.

the following code are the changes made to the product demo.


TfmMain.Button1Click procedure (Sender: TObject); var
   WFD: TWorkFlowDefinition;
   wfi: TWorkFlowInstance;
   i: Integer;

begin
   WFD: = WorkflowStudio1.WorkFlowManager.FindWorkflowDefinitionByName ("Deployment workflow");
   if not Assigned (WFD) then
    exit;

   wfi: = WorkflowStudio1.WorkflowManager.CreateWorkflowInstance (WFD);
   if not assigned (wfi) then
    exit;

   WorkFlowStudio1.WorkflowEngine.RunWorkflow (wfi);

   wfd.Free;
   wfi.Free;

HOPEFULLY COULD HELP ME FIND THE ERROR

thanks

Hello Jose,

 

Do not destroy workflow instance after calling RunWorkflow.

RunWorkflow runs in a synchronized thread and thus returns immediately, so you are destroying workflow instance before it gets executed. You don't need to do that, RunWorkflow will destroy the instance when it's finished.