Table of contents

Official Content

Suppose you need to start a process instance every day in the morning, the steps to follow will be the following:

Step 1.

Create a Genexus Procedure with the Main program property in 'Yes', Call protocol property with the 'Command line' value and the following source code: 

&process = &server.GetProcessDefinitionByName('<process_name>')
&procInstance = &process.CreateInstance()
&procInstance.Subject = '<process_instance_subject>' //optional, by default is the process definition name 

Where the data types variables are the following:

&server         - WorkflowServer
&process        - WorkflowProcessDefinition
&procInstance   - WorkflowProcessInstance
Note: <User_Name> must be an administrator user. 

Step 2.

Create a .bat file with the following source code:

cd <path file>

For example:

cd C:\Models\GXFLOW_X_KB\CSharpModel\Web\bin

Step 3.

Include this .bat file into a windows scheduled task.

Last update: November 2023 | © GeneXus. All rights reserved. GeneXus Powered by Globant