In every Bizagi project, it is possible to generate XML schema definitions (XSDs) for any entity.
This feature which generates an XML schema of your process data model, or creates transformation files is especially powerful for integration purposes.
The data model XML schema will describe the structure handled and expected in processes while invoking Bizagi API from an external application.
Alternatively, you may use this definition as well (along with transformation files) from within business rules to either obtain information in the processes or update it back.
These 2 options are described below.
Generating an XML schema of any entity or the complete process data model will serve you as a reference when using specific web methods of Bizagi API, when there's the need of sending business information into Bizagi from an external application.
To generate a XSD, follow these steps:
1. In the Expert View, select Entities in the Bizagi menu and right-click the entity you wish to generate a schema for.
Notice that for SOA layer use, you should select an Application entity rather than a Master entity.
Select XML Schemas.
2. In the Entity XML Schemas window, click on the Generate button to open the Schema Data Selection window.
3. In this window, choose all the information that needs to be retrieved to insert, update or select.
Notice that it is possible to select information in relating entities using Xpath navigation, by expanding the nodes associated to the relations of the upper-level entity.
3. Once you are finished, click OK. The generated XSD will be shown.
This schema will represent the data model structure as expected by Bizagi when using its SOA layer.
By default, the name of the XSD will be the same as the entity, but it can be changed by clicking the Edit button (or double-clicking on the XSD).
Transformations (XSL/XSLT) can be associated with XSDs in order to grant you the possibility to interpret and re-format information obtained from Bizagi data model.
Associating a transformation to an XSD is mostly used when invoking web services from within business rules in Bizagi (though recall that the recommended and preferred approach when invoking web services is by using the WS connector instead).
The following option is mainly featured for backwards compatibility.
To associate a transformation, you need a generated XSD and therefore, we part from the steps instructed in the previous section Generating a XSD.
Take into account that the transformation file itself needs to be previously created and saved into a local folder (creating a standard XML transformation, which in turn requires technical expertise).
To create that transformation file note that you may use third-party tools which are specialized in topics regarding manipulation of XMLs.
To associate an existing transformation file, the following steps are carried out:
1. After a XSD has been generated, select it and click the Add button.
2. The new Add Xsl window opens to provide the basic information, enter a Name and Description.
For Direction, select "In" or "Out" depending on how the transformation will be used:
•Out: if it is going to transform information obtained from Bizagi's data model so that it can be sent to another application or system.
•In: if it is going to transform information obtained from another system, which will be updated into Bizagi.
Then, browse your folders to select your transformation file (by clicking on Select File).
3. Finally click on OK to save.
The associated transformation file will be shown:
Using the generated XSDs and XSLTs
As pointed out previously, XML Schema files are mainly useful for integration purposes in which an external application will invoke Bizagi API.
This way, you can know which XML structure is the one expected by Bizagi.
Note that though it is not recommended, the schemas and transformations generated through this feature in Bizagi, can also be used from within Bizagi business rules.
For more information about the latter option, refer to Methods for interfaces.