<< Click to Display Table of Contents >> Get Case Data Using XPaths |
Overview
This Web method is used to obtain both business information and general detail (e.g creation date, expiration date, etc) for a given Process instance (case), from an external application.
This method receives a single input having mainly: The case identifier, XPath filters to define which business information (data model fields) we want to retrieve from the detailed search.
This method returns files attached to the case when the case and the activity or event is active. Getting files from closed cases or activities is not supported. |
•For the getCaseDataUsingXPaths method, the request and response XML's are of the native .NET XmlDocument type.
•For the getCaseDataUsingXPathsAsString method the same XML structure is handled, but this parameter is sent as a string type using CDATA.
Input
Input Schema
The following shows a sample XML structure of information to send to Bizagi:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="BizAgiWSParam">
<xs:complexType>
<xs:sequence>
<xs:element name="CaseInfo" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element name="IdCase" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="CaseNumber" minOccurs="0" maxOccurs="1" type="xs:integer" />
</xs:choice>
<xs:choice>
<xs:element name="TaskName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="IdTask" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="IdWorkItem" minOccurs="0" maxOccurs="1" type="xs:integer" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="XPaths" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="XPath" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="XPath" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Input Parameters
•IdCase: Internal identification number (identifier in the database) of the case in Bizagi.
•CaseNumber: Case number or creation number of the case. If the previous element is used, this one is not necessary.
•TaskName: This element must be used in conjunction with the IdCase or CaseNumber. When it is included in the query, the returned information will be the data saved in an ongoing Task (only for manual Activities or available Intermediate Events), if not, only data existing in the database is retrieved.
•IdTask: Instead of the TaskName, it is possible to use the Task’s internal identification number (identifier in the database).
•IdWorkItem: Another way to obtain the information of a specific Task in the case is by just sending the identification number of the workitem (the WORKITEM table holds information about the performed and current Tasks of every case). If this element is filled, then the Task’s name or identifier, nor the idCase or creation number, is necessary.
It is important that the identifier sent here is of an opened workitem, not of one that has already been performed.
•Xpaths: Contains one or more nodes of the type "XPath", which are used to specify filtering information related to data model's (business information).
•XPath: Include this element for each XPath in the query. This element, in turn, has an attribute also named XPath, the value of this attribute will be the required Bizagi XPath.
Input Example
The following example is done for a Credit Request Process having the following data model and required information:
With the following example, we will query the information of case having identifier number 8451. This case has an active Task with id= 180. The desired information is: BuroScore, BuroFile, DocumentNumber and the DocsDelivieryDate from the Applicant entity (for all of the Applicants related to this request).
In addition to this, we want to retrieve as well the DocumentNumber of applicants having a BuroScore less than 100.
For this filter it is necessary to use the less-than sign (<), but this is a reserved special character in XML notation; and therefore it should be included in a XML format (as "<").
The following table provides the XML format equivalent to use, for those scenarios where reserved special characters in XML are required(commonly used).
Character |
Description |
XML Format to use |
---|---|---|
< |
Less-than sign |
< |
> |
Greater-than sign |
> |
" |
Double quotation mark |
" |
' |
Single quotation mark (or apostrophe) |
' |
& |
Ampersand |
& |
We suggest you use How to start a process in Bizagi from other applications as a guideline to invoke this service.
GetCaseDataUsingXPaths Method Input
<BizAgiWSParam>
<CaseInfo>
<CaseNumber>8451</CaseNumber>
<IdTask>180</IdTask>
</CaseInfo>
<XPaths>
<!-- Integer type attribute -->
<XPath XPath="idApplicant.BuroScore" />
<!-- XPath with error -->
<XPath XPath="idApplicat.BuroScore" />
<!-- File type attribute -->
<XPath XPath="idApplicant.BuroFile" />
<!-- String type attribute -->
<XPath XPath="idApplicant.DocumentNumber" />
<!-- Collection without filter and attributes -->
<XPath XPath="idApplicant.Applicants" />
<!-- Collection with filter and attribute -->
<XPath XPath="idApplicant.Applicants[BuroScore < 100].DocumentNumber" />
<!-- Date type attribute -->
<XPath XPath="idApplicant.DocsDeliveryDate" />
</XPaths>
</BizAgiWSParam>
GetCaseDataUsingXPathsAsString Method Input
<sXml>
<![CDATA[<BizAgiWSParam>
<CaseInfo>
<CaseNumber>8451</CaseNumber>
<IdTask>180</IdTask>
</CaseInfo>
<XPaths>
<!-- Integer type attribute -->
<XPath XPath="idApplicant.BuroScore" />
<!-- XPath with error -->
<XPath XPath="idApplicat.BuroScore" />
<!-- File type attribute -->
<XPath XPath="idApplicant.BuroFile" />
<!-- String type attribute -->
<XPath XPath="idApplicant.DocumentNumber" />
<!-- Collection without filter and attributes -->
<XPath XPath="idApplicant.Applicants" />
<!-- Collection with filter and attribute -->
<XPath XPath="idApplicant.Applicants[BuroScore < 100].DocumentNumber" />
<!-- Date type attribute -->
<XPath XPath="idApplicant.DocsDeliveryDate" />
</XPaths>
</BizAgiWSParam>]]>
</sXml>
Output
Output Schema
The following shows a sample XML structure of information returned by Bizagi:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="BizAgiWSResponse">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="XPath">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Items">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Item">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Id" type="xs:integer" use="optional" />
<xs:attribute name="FileName" type="xs:string" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="XPath" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="Error">
<xs:complexType>
<xs:sequence>
<xs:element name="ErrorCode" type="xs:integer" />
<xs:element name="ErrorMessage" type="xs:string" />
</xs:sequence>
<xs:attribute name="XPath" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Output Parameters
•BizAgiWSResponse: The root node.
•XPath: An element present for each of the values retrieved, as specified in the input parameter.
Note that this element may have more than one value (specifically for attachment files and collection values). If this is the case, refer to the Items description.
•Items: Contains the value, when the XPath element contains multiple values.
•Error: Contains information in the eventual case of an error in the invocation.
•ErrorCode: The error code for the error (should an error occur).
•ErrorMessage: The descriptive error message for the error (should an error occur), and its inner elements correspond to the Schema defined in the input parameters.
Output Example
GetCaseDataUsingXPathsAsString Method Ouput
With the following sample returned XML-structured response from Bizagi SOA layer, we can see that business information is returned, as well as an error for a requested attribute:
GetCaseDataUsingXPathsAsString Method Output
The following example shows how an error message is displayed:
Related Web methods
If you wish to use a Schema definition to specify which business information (data model fields) you want to retrieve, use the getCaseDataUsingSchemaAsString Web method.
For further information refer to the Get Case Data Using Schema article.
Last Updated 1/6/2022 5:12:53 PM