Migrate ODF 2 project to version 10.2.8
The guide describes the steps to migrate an ODF 2-based project from v10.2.7 to v10.2.8.
Migrate ODF 2 project
To migrate an ODF 2-based project from v10.2.7 to v10.2.8, do as follows:
Open the root
pom.xmlof your project. In the<properties>section, find the<odf2.version>property.Update the ODF 2 version according to the compatibility matrix. Also, update the
<bundle-versions-maven-plugin.version>and<bundle-maven-plugin.version>properties for Bundle version Maven plugin and Bundle Maven plugin accordingly:<!-- TODO: update versions after the 10.2.8 public release --> <properties> <odf2.version>10.2.8.X</odf2.version> <bundle-versions-maven-plugin.version>0.0.30</bundle-versions-maven-plugin.version> <bundle-maven-plugin.version>10.2.8.X</bundle-maven-plugin.version> </properties>Build the project with the
mvn clean verifycommand. Make sure there are no compilation errors, and all unit tests of your project have passed successfully.
The 10.2.8 version of the frameworks introduces several alterations that you should take note of. These modifications might necessitate corresponding adjustments in your Digital Worker project.
Binding reader
From version 10.2.8 onward, BindingReader has undergone a transformation into an interface, resulting in the removal of certain methods. This modification was necessary to decouple the ODF 2 core from any WebHarvest dependencies, enabling seamless compatibility with the Native Java Worker.
Notably, BindingReader no longer grants access to the WebHarvestTaskItem variable. Instead, contextual data for bot tasks should now be directly acquired from the BindingReader itself. For instance:
// before 10.2.8
String campaignUuid = bindingReader.getTaskItem().getCampaignDto().getUuid();
String runUuid = bindingReader.getTaskItem().getRun().getUuid();
// after 10.2.8
Optional<UUID> campaignUuid = bindingReader.getBpStepDefinitionId();
Optional<UUID> runUuid = bindingReader.getBpStepId();
WebHarvest integration
Beginning with version 10.2.8, ODF 2 introduces a new odf2-webharvest-integration Maven module. This module encapsulates all the essential code, service implementations, and dependencies essential for the WebHarvest runtime.
If you're utilizing any of these services, it's probable that your BCB code will no longer compile successfully. To resolve this, you should include the odf2-webharvest-integration artifact in the dependencies section of your BCB module.
<dependency>
<groupId>com.workfusion.odf2</groupId>
<artifactId>odf2-webharvest-integration</artifactId>
</dependency>
OCR client
Beginning with version 10.2.8, ODF 2 has eliminated all OCR dependencies from its core. If you require OCR integration, we suggest utilizing the OCR Bridge step.
If your code relies on the deprecated OCR client, and you have no intentions of transitioning to the OCR Bridge step, you will be required to manually include the following dependency into your BCB's pom.xml file:
<dependency>
<groupId>com.workfusion.odf2</groupId>
<artifactId>odf2-ocr</artifactId>
</dependency>
Billing service
From version 10.2.8 onwards, the ODF 2 framework introduces a new layer of abstraction for the billing information service. To incorporate this functionality, you can inject the com.workfusion.odf2.service.billing.BillingService object into a bot task as demonstrated in the example below:
@BotTask
public class BillingBotTask implements AdHocTask {
private final BillingService billingService;
@Inject
public BillingBotTask(BillingService billingService) {
this.billingService = billingService;
}
@Override
public TaskRunnerOutput run(TaskInput taskInput) {
final String jsonData = taskInput.getRequiredVariable("json_billing_data");
final boolean billingResult = billingService.sendInfo(jsonData);
return taskInput.asResult().withColumn("billing_result", String.valueOf(billingResult));
}
}
Migration templates
Starting from 10.2.8 version, the ODF 2 framework allows you to manage Liquibase migrations for the Standard Data Model automatically using migration templates. For instructions to migrate your project to the new approach, refer to the guide.
Native Java Worker integration
Beginning with version 10.2.8, the ODF 2 framework now offers a seamless way to transition a Digital Worker project to the Native Java Worker approach. If you're interested in learning how to migrate your project to this new approach, see the guide for detailed instructions.