BPM, Workflow, and Case

 View Only

Create Business Objects from a JSON OpenAPI schema file

By LATHA RAMAKRISHNAIAH posted Mon July 01, 2024 01:55 AM

  

Co-Author: Balunaini Prasad

Background:

Some customers have large number of complex business objects authored and governed outside of workflow automation products. These business objects could have multiple properties of different types along with references to other business objects. Manually defining them from workflow process designer (WebPD) tool is a time taking exercise. Importing business objects defined in JSON schema to workflow process designer saves significant time during application design. The JSON schema file must adhere to OpenAPI v3.0 schema specifications. This new feature provides an option to import JSON OpenAPI v3.0 schema files from Workflow Process Designer tool.

Support:

CP4BA only

Input JSON schema file:

Business Objects that are defined in a JSON schema file should follow OpenAPI schema v3.0 specification. The schema file should mandatorily contain ‘openapi’, ‘info’ and ‘components’ fields. For more details on OpenAPI v3.0 specifications, refer - https://spec.openapis.org/oas/v3.0.0

Sample input schema file:

  The below sample JSON schema file has business objects like Flight and Hotel defined in it. Flight business object has properties id, airline, flightNumber, departure, etc.

Steps to import business objects:

       1. To Import the Business Objects, go to Workflow Process Designer -> Data->+-> and click on ‘Import business objects’ option

A screenshot of a computer

Description automatically generated

  

       2. Select the OpenAPI JSON schema file and click on Next. Any syntax errors in the JSON schema file will be shown as a pop-up dialog. Other errors related to   OpenAPI support from Web Process Designer will be shown in the next dialog along with the explanation of the errors found. These errors/warnings need to be addressed before proceeding further.


      3.If there are no errors, click Finish. The defined business objects in the schema will be imported to the Workflow Process Designer.

      4. The newly imported business objects will be shown under ‘Data->Business object’ section. It will be tagged as ‘Discovered’. The imported schema file will be displayed under ‘Data -> Imported schema files’.

          Note: Deleting an imported schema file will delete all the business objects that were imported as part of the import of this schema file.

A screenshot of a computer

Description automatically generated

Re-importing the schema file:

    The business objects that are created by importing a JSON schema are in read-only mode in the Process Designer. The schema file can be updated (in the file system) for any changes to the business object definitions like:

·       adding new properties

·       updating an existing property

·       deleting a property

·       adding new business objects

·       renaming business objects

   We allow re-importing this updated schema file so that all changes are applied in the Process Designer. For example, the schema file is updated by adding a new boolean property “isDomestic”, changing “id” from String to Integer and deleting another property “airlineType”. The updated schema file is as below.

  When the updated schema file is re-imported, the changes to the business object as seen in the Process Designer is shown below:

A screenshot of a computer

Description automatically generated

Multiple schema files having same business object definition:

  There might be instances where some of the business objects might be existing in multiple schemas. In such a scenario when we import consecutive schemas there will be a numerical value “_n” appended to the business object name to retain the uniqueness of the object. Suppose Flight business object is defined in TravelBooking.json as well as in  ‘TravelBooking Another Schema.json’, then importing both these schemas will create Flight and Flight_1 business objects in the Process Designer as shown below.


#BusinessAutomationWorkflow(BAW)

0 comments
22 views

Permalink