Skip to main content
Version: 10.2.9

Schedule Business Process via Bot Task

The Business Process (BP) comprises a Bot Config emulating the functionality of the Scheduler. You can add the custom logic to stop a BP that is not completed and re-run it over time.

Explore workflow

The BP operates as follows:

  1. Stops the run for the record in the Data Store (with the IN_PROGRESS status and Data Source UUID from the ETL form) by making a REST API call and sets the STOPPED status.

  2. Runs the Business Process with the Data Source UUID from the ETL form using the task-start plugin. The plugin returns the run UUID. The Bot Config inserts a new record to the Data Store with the IN_PROGRESS status for the Data Source UUID.

  3. Using the release plugin, the Bot Config is turned to sleep for a specific time and then executes the step again.

  4. Optionally, you can add the code below to the Bot Config to update the record status in the Data Store to COMPLETED:

    <script>
    <![CDATA[
    import com.freedomoss.crowdcontrol.webharvest.RunDto;
    import com.freedomoss.crowdcontrol.webharvest.WebHarvestTaskItem;

    RunDto run = (RunDto) ((WebHarvestTaskItem) item.getWrappedObject()).getRun();
    String run_uuid= run.rootRunUuid;
    ]]>
    </script>
    <datastore name="SchedulerDatastore">
    update @this set status = 'COMPLETED' where run_uuid=\${run_uuid};
    </datastore>

Prepare

To prepare for using the Scheduler BP, follow the steps below:

  1. Add a Secrets Vault alias:

    AttributeValue
    aliasbasic.hash.for.rest
    keybasic.hash.for.rest
    value<you credentials hash>
  2. Create a Data Store for monitoring and name it SchedulerDataStore. See the sample Data Store record below:

  3. Import the BP with the Scheduler to the instance.

Use Scheduler

Follow the steps below:

  1. Start the imported BP with the Scheduler and provide the Data Source UUID on the ETL form for the Business Process you want to run.
  2. To find the Data Source UUID, go to Data Sources > View all, set the filter to Composite, and find your BP by title.
  3. Open the Business Process, go to the Enter Property tab, and see the UUID in the Data Source UUID field.