<< Click to Display Table of Contents >> Create Cases |
Overview
This Web method is used to create any number of cases in Bizagi (starting Processes) with initial business information (from an external application).
This method receives a single input having mainly: any occurrences of details having the creator user, the Process to be started, and optionally any initial business information for these cases (any data, attachments, etc).
Through this method, a Process instance (case) is started, in the same way as it would be done at the Work Portal.
For further information about creating cases from the Work Portal options, please refer to Bizagi Work Portal.
•For the createCases method, the request and response XML's are of the native .NET XmlDocument type.
•For the createCasesAsString method the same XML structure is handled, but this parameter is sent as a string type.
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 xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="BizAgiWSParam">
<xs:complexType>
<xs:sequence>
<xs:element name="domain" type="xs:string"/>
<xs:element name="userName" type="xs:string"/>
<xs:element name="Cases">
<xs:complexType>
<xs:sequence>
<xs:element name="Case" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Process" type="xs:string"/>
<xs:element name="Organization" type="xs:string"/>
<xs:element name="Entities">
<xs:complexType/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Input Parameters
•BizAgiWSParam: Root node.
•domain: Contains the domain name of the Bizagi user, which will be registered as the one who created the case.
•userName: Contains the name (used in Bizagi) of the user, which will be registered as the one who created the case.
•Cases: This element is included to enclose several case elements depending on the number of cases being created.
•Case: Here, the information of the case to be created, is included.
•Organization: Enter the id of the organization to which this case will be associated (useful when having multiple organizations). By default when this element is not specified, the default organization (id=1) will be employed.
•Process: In this element, write the name (not display name) of the Process.
•Entities: Include here the information (XML-structured) that will be set in the data model for the newly created case.
For further information about the expected structured for the business information contained in this Entities element, refer to Bizagi's data model XML schemas.
Input Example
With the following sample XML, two cases of the Credit Process will be created.
If you wish to follow a detailed business example using this Web method, refer to How to start Processes in Bizagi from other applications.
CreateCases Method Input
<BizAgiWSParam>
<domain>domain</domain>
<userName>admon</userName>
<Cases>
<Case>
<Process>Credit</Process>
<Entities>
<idRequest>
<Applicants>
<Applicant>
<DocumentNumber>785621</DocumentNumber>
<idDocumentType businesskey="Name='CC'" />
<BuroScore>5</BuroScore>
</Applicant>
</Applicants>
</idRequest>
</Entities>
</Case>
<Case>
<Process>Credit</Process>
<Entities>
<idRequest>
<Applicants>
<Applicant>
<DocumentNumber>568977</DocumentNumber>
<idDocumentType businesskey="Name='TI'" />
<BuroScore>a</BuroScore>
</Applicant>
</Applicants>
</idRequest>
</Entities>
</Case>
</Cases>
</BizAgiWSParam>
CreateCasesAsString Method Input
<casesInfo>
<![CDATA[<BizAgiWSParam>
<domain>domain</domain>
<userName>admon</userName>
<Cases>
<Case>
<Process>Credit</Process>
<Entities>
<idRequest>
<Applicants>
<Applicant>
<DocumentNumber>785621</DocumentNumber>
<idDocumentType businesskey="Name='CC'" />
<BuroScore>5</BuroScore>
</Applicant>
</Applicants>
</idRequest>
</Entities>
</Case>
</Cases>
</BizAgiWSParam>]]>
</casesInfo>
There are two ways when using businesskeys :
•Using it as an attribute of a tag: <Applicant businessKey="DocumentNumber = '123456'">
•Or using it as an individual tag: <DocumentNumber>123456</DocumentNumber>
Be aware that can never use both at the same time. For further information refer to Using business keys in XMLs. |
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="processes">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="process">
<xs:complexType>
<xs:sequence>
<xs:element name="processId" type="xs:integer" />
<xs:element minOccurs="0" name="processRadNumber" type="xs:string" />
<xs:element minOccurs="0" name="savedMessage">
<xs:complexType>
<xs:sequence>
<xs:element name="Entities" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="processWorkflowClass">
<xs:complexType>
<xs:sequence>
<xs:element name="workflowClassId" type="xs:integer" />
<xs:element name="workflowClassName" type="xs:string" />
<xs:element name="workflowClassDisplayName" type="xs:string" />
<xs:element name="workflowClassDescription" type="xs:string" />
<xs:element name="workflowClassHelpText" type="xs:string" />
<xs:element name="workflowClassDisplayOrder" type="xs:integer" />
<xs:element name="workflowClassCreationDate" type="xs:string" />
<xs:element name="workflowClassGlobalForm" type="xs:integer" />
<xs:element name="workflowClassAllocationPrinciple" type="xs:string" />
<xs:element name="workflowClassProcessType" type="xs:string" />
<xs:element name="workflowClassDisplay" type="xs:string" />
<xs:element name="workflowClassUseParentRadicationNumber" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="processError">
<xs:complexType>
<xs:sequence>
<xs:element name="errorCode" type="xs:string" />
<xs:element name="errorMessage">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Entities">
<xs:complexType>
<xs:sequence>
<xs:element name="Path" type="xs:string" />
<xs:element name="Atrib" type="xs:string" />
<xs:element name="Value" type="xs:string" />
<xs:element name="ErrorMessage" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CurrentWorkItems">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="workItem">
<xs:complexType>
<xs:sequence>
<xs:element name="workItemId" type="xs:integer" />
<xs:element name="workItemState" type="xs:string" />
<xs:element name="workItemEntryDate" type="xs:string" />
<xs:element name="workItemDuration" type="xs:integer" />
<xs:element name="workItemEstimatedSolutionDate" type="xs:string" />
<xs:element name="task">
<xs:complexType>
<xs:sequence>
<xs:element name="taskId" type="xs:integer" />
<xs:element name="taskName" type="xs:string" />
<xs:element name="taskDisplayName" type="xs:string" />
<xs:element name="taskDescription" type="xs:string" />
<xs:element name="taskHelpText" type="xs:string" />
<xs:element name="taskEstimatedDuration" type="xs:integer" />
<xs:element name="taskType" type="xs:string" />
<xs:element name="taskCost" type="xs:integer" />
<xs:element name="taskPriority" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Output Parameters
•processes: Root node.
•process: This element is included for each case that is to be created.
•processId: Identification number of the case (idCase).
•processRadNumber: Alphanumeric value corresponding to the creation number of the case.
•savedMessage: Reserved for future use.
•Entities: Reserved for future use.
•processWorkflowClass: The information in this node is all about the Process (Process metadata) not about the particular case.
•workflowClassId: Identification number (or key) of the Process.
•workflowClassName: Name of the Process.
•workflowClassDisplayName: Display name of the Process.
•workflowClassDescription: Process description.
•workflowClassHelpText: Process help text.
•workflowClassHelpURL: Help URL for the Process.
•workflowClassDisplayOrder: The order in which the Process will be viewed in the web application.
•workflowClassCreationDate: Creation date of the Process.
•workflowClassGlobalForm: Identification number of the Process’s global form (zero if it is not configured).
•workflowClassAllocationPrinciple: Reserved for future use.
•workflowClassProcessType: Process type.
•workflowClassDisplay: Indicates whether the Process is visible or not.
•workflowClassUseParentRadicationNumber: Indicates if a case of this Process uses its own creation number or the same number as the parent Process (if it is a sub-process).
•workflowClassSupportScopes: Indicates if the Process supports long-term transactions in Bizagi (Scopes); which is an efficient method of data persistence.
•processError: If the Process of canceling a case is not successful, this element will contain information of the error.
•errorCode: Code of the error that occurred, otherwise it will be empty.
•errorMessage: Message of the error that occurred, otherwise it will be empty.
•Path: XPath of the element, in the request XML, generating the error. Visible when the error is caused by wrong data.
•Attrib: Is the name of the attribute in Bizagi where the saved operation was attempted. Visible when the error is caused by wrong data.
•Value: Is the value which caused the error. Visible when the error is caused by wrong data.
•ErrorMessage: Message explaining why the error occurred. Visible when the error is caused by wrong data.
•CurrentWorkItems: The set of Activities available for the case.
•workItem: This is a specific Activity (an instance of a Task) of the Process that is active for the case.
•workItemId: Identification number or key of the Activity.
•workItemState: State in which the Activity is.
•workItemEntryDate: Date and time when the case reached this Activity.
•workItemDuration: Is the estimated duration, in minutes, for this Activity.
•workItemEstimatedSolutionDate: Is the case’s estimated solution date.
•task: Contains information about the Task corresponding to the Activity.
•taskId: Identification number or key of the Task.
•taskName: Name of the Task.
•taskDisplayName: Display name of the Task.
•taskDescription: Task’s descriptive text.
•taskHelpText: Task’s help text.
•taskEstimatedDuration: Is the estimated duration, in minutes, for the Task.
•taskType: Type of Task.
•taskCost: The estimated cost of the Task. This value, like the estimated dates, is configured and determined by the designer of the Process.
•taskPriority: Fulfillment priority of the Task.
Output Example
In the following example, we illustrate a returned XML-structured response from Bizagi SOA layer, in which we can see:
CreateCases Method Output
•For the first node, a Process case was started successfully.
•For the second node, the case could not be created. Within the response, error detail is found at ProcessError, in which there is an attribute's value which could not be stored due to incorrect data-type format.
CreateCasesAsString Method Output
For this node, the process does not exist.
Related Web methods
If you wish to perform an available Activity in the Process instead (those at the Inbox), use the performActivityAsString or performActivity Web method.
For further information refer to the Perform Activity article.
Last Updated 1/6/2022 5:13:37 PM