Skip to content

I already use BotCity

If you already use BotCity and have automations in the BotCity Orchestrator, you just need to make a small change in the code of each automation to start reporting items to BotCity Insights.

Update the code of an existing automation

Change the finish_task method call to include the number of items processed during the execution.

maestro.finish_task(
    task_id=execution.task_id,
    status=AutomationTaskFinishStatus.SUCCESS,
    message="Task Finished OK.",
    total_items=100, # Total number of items processed
    processed_items=90, # Number of items processed successfully
    failed_items=10 # Number of items processed with failure

)

Maestro SDK Version

To ensure all parameters are recognized during the automation execution, remember to update the BotCity Maestro SDK dependency to the latest version:
pip install --upgrade botcity-maestro-sdk

You also need to update the version in the robot's requirements.txt file.

maestro.finishTask(
    botExecution.getTaskId(),
    "Task Finished OK.",
    FinishStatus.SUCCESS,
    100, // Total number of items processed
    90, // Number of items processed successfully
    10 // Number of items processed with failure
);

Maestro SDK Version

Remember to update the BotCity Maestro SDK Java to the latest version.

<dependencies>
    <dependency>
        <groupId>dev.botcity</groupId>
        <artifactId>maestro-sdk</artifactId>
        <version>2.2.0</version>
    </dependency>
</dependencies>
await maestro.FinishTaskAsync(
    execution.TaskId,
    FinishStatusEnum.SUCCESS,
    "Task Finished OK.",
    100, // Total number of items processed
    90, // Number of items processed successfully
    10 // Number of items processed with failure
);

Reprocess old tasks

The code change applies only to tasks executed from the new version of the automation onward. Tasks executed before the change remain without reported items and, therefore, are not included in the Savings, Hours Saved, FTE, and ROI calculations.

To include these tasks in the indicators, use the Reprocess items feature in Data Input. There, you retroactively enter the number of processed and failed items for each old task.

Reprocess items

Reprocessing requires the automation to have its financial values filled in and accepts a period of up to 6 months per request.

See more at: