XML Helper object

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business Rules examples >

XML Helper object

Overview

The XML Helper object is part of Bizagi's business rules API, and it provides data access for your processes when working with XML-structured information.

This is a useful alternative given that the data access engine in Bizagi relies on several optimization features when it comes to working a native format for Bizagi's, such as XMLs.

It works both when wanting to query information from Bizagi, or when inserting/updating information into Bizagi.

 

For instance and when triggering Bizagi's BPMN Engine from within a Bizagi business rule to create new cases, or complete events and activities (e.g, for collaboration between processes in Bizagi).

Triggering the Bizagi's BPMN Engine considers the use of CHelper.NewCase(), CHelper.setEvent(), or CHelper.PerformActivity() among others, all which can use XML-structured information as inputs.

 

The XML Helper object

Bizagi provides a set of methods in this object to directly handle XMLs, and work with information just as how Bizagi manages it.

This object is instantiated by using coding in business rules Expression boxes using the CEntityXmlHelper class.

 

Before you continue

Keep in mind that using this methods requires technical skills oriented to use of XMLs and transformation files (XSLT), and it also demands expertise when working with Bizagi and how the information is handled within its scopes.

For more information, refer to Scopes.

Note that these methods will generally:

Receive entity instances within their parameters. Hence, be sure to review the Entity Manager methods and understand their input parameters before using the XML Helper object.

Rely  the use of CHelper.NewCase(), CHelper.setEvent(), or CHelper.PerformActivity() among others.

Feed on predefined XML Schemas and transformations from the Entities' definitions.

For more information about this option, refer to Bizagi's data model XML schemas.

 

Methods

The following methods are presented according to what they are useful for.

 

Query information stored directly at specific Entities

These should be used mainly when working with Parameter type entities, given that do not consider information that is stored in scopes and you may query such information without having XPath navigation.

 

METHOD

INPUTS

OUTPUTS

DESCRIPTION

NOTES

getEntitiesAsString

 

string entityInfo, string xsd

string

Obtains records of a specified entity in an XML-structured string.

 

The XML structure should match that one used by the getEntities web method of Bizagi's API.

 

The xsd parameter uses a string representation of an XML schema so that the information of records include only those attributes specified in the schema.

Other methods similar to this one are deprecated and preserved mainly for backwards compatibility.

Such methods should not be used.

 

To view an example on its use, refer to Querying XML-based information in entities.

 

Query information regarding cases (with scopes)

These methods consider information which is part of what being managed by a case, still in Bizagi's scope.

 

METHOD

INPUTS

OUTPUTS

DESCRIPTION

NOTES

getCaseAsString

 

int IdCase,

string xsd,

string xsl, string xpathContext

string

Obtains information which applies to a case (in an XML-structured string), including a closed case or a different case other than the one being worked on.

 

The xsd parameter is optional, and uses a string representation of an XML schema so that the information of records include only those attributes specified in the schema (to be built starting from the Application entity).

 

The xsl parameter uses a string representation of an XML transformation file so that it is applied to the result.

 

The xpathContext uses a string representation of XPath Context defining where Bizagi will start to interpret the schema.

Other methods similar to this one are deprecated and preserved mainly for backwards compatibility.

Such methods should not be used.

 

To view an example on its use, refer to Querying XML-based information in cases (with scopes).

 

Insert or update information in Entities

These should be used mainly when working with Parameter type entities, given that do not consider information that is stored in scopes and you may access such entities without having XPath navigation.

For these methods, you should consider your existing business key definitions, as described at Using business keys in XMLs.

 

METHOD

INPUTS

OUTPUTS

DESCRIPTION

NOTES

saveEntityAsString

 

string entityInfo

string

 

Inserts or updates at the entities specified.

 

The XML structure should match that one used by the saveEntity web method of Bizagi's API (without using the entityInfo node), where relying on business keys definitions is supported to update exiting records.

Other methods similar to this one are deprecated and preserved mainly for backwards compatibility.

 

To view an example on its use, refer to Updating XML-based information in entities.

 

Insert or update information regarding cases (with scopes)

These methods consider information which is part of what being managed by a case, still in Bizagi's scope.

For these methods, you should consider your existing business key definitions, as described at Using business keys in XMLs.

 

METHOD

INPUTS

OUTPUTS

DESCRIPTION

NOTES

saveCaseAsString

int idCase, string entityInfo, boolean businessKey

boolean

Updates information into a given case, including a closed case or a different case other than the one being worked on.

 

The idCase parameter is necessary to define the case to which information will be applicable.

 

The XML structure should match that one used by the saveEntities web method of Bizagi's API, but while ensuring its root node is the process entity.

 

The businessKey parameter is to be set to false so that business key definitions as predefined, are used.

Other methods similar to this one are deprecated and preserved mainly for backwards compatibility.

 

To view an example on its use, refer to Updating XML-based information in cases (with scopes).

 

Methods to manipulate information (using XML schemas and transformations)

For instance, these allow you to apply XML transformations to business information.

 

METHOD

INPUTS

OUTPUTS

DESCRIPTION

NOTES

transformXmlAsString

string xml,

string xsl

String

Applies a transformation to XML information, by relying on standard XSLT 1.1, and obtaining the transformed result.

 

The xml parameter uses a string representation having XML-structured information.

 

The xsl parameter uses a string representation of an XML transformation file so that it is applied to the result.

Other methods similar to this one are deprecated and preserved mainly for backwards compatibility.

 

To view an example on its use, refer to Applying a XSL transformation.


Last Updated 1/6/2022 4:21:27 PM