<< Click to Display Table of Contents >> Set Event |
Overview
This web method is used to trigger any number of available business events from an external application.
Business events in Bizagi are modeled through standard BPMN Events, in which Intermediate type Events with no specific type defined, are available at certain point in the Processes to listen to an external Event.
This method receives a single input having mainly: The information of the end user triggering the Event, the specific Process instance to be worked on (case number), the given Event name representing that available intermediate Event, and any additional business information to be inputted or updated.
Through this method, Bizagi sets an Event as completed, in the same way as it would be done at the Work Portal.
For further information about completing work from the Work Portal options, please refer to Bizagi Work Portal.
•For the setEvent method, the request and response XML's are of the native .NET XmlDocument type.
•For the setEventAsString 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="Events">
<xs:complexType>
<xs:sequence>
<xs:element name="Event" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="EventData">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element name="idCase" type="xs:integer" minOccurs="0"/>
<xs:element name="radNumber" type="xs:string" minOccurs="0"/>
</xs:choice>
<xs:choice>
<xs:element name="idTask" type="xs:integer" minOccurs="0"/>
<xs:element name="eventName" type="xs:string" minOccurs="0"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<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: Here goes the name of the domain for the Bizagi user who will be registered as the performer of the triggered Event.
•userName: Name of the user who will be register as performer of the triggered Event.
•Events: Contains the information of all Events.
•Event: Contains the information of a particular Event.
•EventData: Contains all the necessary information to locate the Event.
•idCase: Is the case identification number for the Event which wants to be triggered. It is required to include this element or the radNumber.
•radNumber: An alternative to the idCase. It is the creation number (case number) of the case containing the pending Event that wants to be continued. When the same creation number is used for several cases (like when a Sub-Process uses its parent’s number) the idCase must be used to distinguish for which case the Event belongs to.
•idTask: It is the identification number for the Event which wants to be executed. This element is necessary; if this number is not known then the eventName must be included.
•eventName: Use as a complement or alternative to taskId, it is the name of the pending Event which wants to be executed.
•Entities: It is a node containing the values for the business data that is going to be set for the 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, we will trigger Events for two different Process instances (two cases).
In this example, we can see that the domain\Raulp user is setting the Events.
One Event is referenced by its Name (Event2), and the other is referenced by its id(idTask=145).
Business information is contained in the Entities elements and it is optional.
We suggest you use How to start a process in Bizagi from other applications as a guideline to invoke this service.
SetEvent Method Input
<BizAgiWSParam>
<domain>domain</domain>
<userName>Raulp</userName>
<Events>
<Event>
<EventData>
<radNumber>501</radNumber>
<eventName>Task3</eventName>
</EventData>
<Entities></Entities>
</Event>
<Event>
<EventData>
<idCase>201</idCase>
<idTask>145</idTask>
</EventData>
<Entities>
<idApplicant>
<BuroScore>5959</BuroScore>
</idApplicant>
</Entities>
</Event>
</Events>
</BizAgiWSParam>
SetEventAsString Method Input
<eventInfo>
<![CDATA[<BizAgiWSParam>
<domain>domain</domain>
<userName>Raulp</userName>
<Events>
<Event>
<EventData>
<radNumber>501</radNumber>
<eventName>Task3</eventName>
</EventData>
<Entities></Entities>
</Event>
<Event>
<EventData>
<idCase>201</idCase>
<idTask>145</idTask>
</EventData>
<Entities>
<idApplicant>
<BuroScore>5959</BuroScore>
</idApplicant>
</Entities>
</Event>
</Events>
</BizAgiWSParam>]]>
</eventInfo>
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. |
Using Empty Tags
Bizagi supports the use of empty attribute tags, for example, from the previous example:
<BuroScore></BuroScore>
Using the empty value, Bizagi does not validate it as a business key. This means that the execution of the method does not show any errors related to a business key.
Setting an attribute to null
Through this method you are able to set a specific attribute to null. To do so, you must set the "nil" attribute to true within the entity's attribute you want to set to null:
<Entities>
<idApplicant>
<BuroScore nil="true"></BuroScore>
</idApplicant>
</Entities>
The prior example does not apply for file or image attributes. |
Output
Output Schema
The following shows a sample XML structure of information returned by Bizagi:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="processes">
<xs:complexType>
<xs:sequence>
<xs:element name="process">
<xs:complexType>
<xs:sequence>
<xs:element name="processId" type="xs:integer"/>
<xs:element name="processRadNumber" type="xs:string"/>
<xs:element name="savedMessage">
<xs:complexType>
<xs:sequence>
<xs:element name="Entities" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="processCreationDate" type="xs:dateTime"/>
<xs:element name="processSolutionDate" type="xs:dateTime"/>
<xs:element 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="workflowClassHelpURL" type="xs:string"/>
<xs:element name="workflowClassDisplayOrder" type="xs:integer"/>
<xs:element name="workflowClassCreationDate" type="xs:dateTime"/>
<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:boolean"/>
<xs:element name="workflowClassUseParentRadicationNumber" type="xs:boolean"/>
<xs:element name="workflowClassSupportsScopes" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="processError">
<xs:complexType>
<xs:sequence>
<xs:element name="errorCode"/>
<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>
<xs:sequence>
<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:dateTime"/>
<xs:element name="workItemDuration" type="xs:integer"/>
<xs:element name="workItemSubprocesses"/>
<xs:element name="workItemEstimatedSolutionDate" type="xs:dateTime"/>
<xs:element name="workItemSolutionDate" type="xs:dateTime"/>
<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:element name="taskTransactional" type="xs:boolean"/>
<xs:element name="taskCompensation" type="xs:boolean"/>
<xs:element name="taskTimerEventDuration" type="xs:integer"/>
<xs:element name="AllowsReassign" type="xs:boolean"/>
<xs:element name="SendNotification" type="xs:boolean"/>
<xs:element name="SendAlarms" type="xs:boolean"/>
<xs:element name="ExtendedEstimatedDuration" type="xs:integer"/>
<xs:element name="Form" type="xs:integer"/>
<xs:element name="IsAsynchTask" type="xs:boolean"/>
<xs:element name="NumberOfRetries" type="xs:integer"/>
<xs:element name="RetryInterval" type="xs:integer"/>
<xs:element name="ShowFeedback" type="xs:boolean"/>
<xs:element name="TimeoutSeconds" type="xs:integer"/>
</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 element containing information about the Processes to which the Events belong.
•process: This element includes information for a Process.
•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) or 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 Bizagi Studio.
•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).
•processError: If the Process of triggering the Event is not successful, this element will contain information or 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 Events or Activities available for the case.
•workItem: This is a specific Event or Activity (an instance of a Task) of the Process that is active for the case.
•workItemId: Identification number or key of the Event/Activity.
•workItemState: State in which the Event/Activity is.
•workItemEntryDate: Date and time when the case reached this Event/Activity.
•workItemDuration: Is the estimated duration, in minutes, for this Event/Activity.
•workItemEstimatedSolutionDate: Is the case’s estimated solution date.
•Task: Contains information about Task corresponding to the Event.
•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.
•taskTransactional: An indicator stating if a Task is transactional.
•taskCompensation: Informs if this is a compensation Task.
•taskTimerEventDuration: If this Task has an attached Timer Event,, it will contain its duration in minutes.
•AllowsReassign: A mark showing if this Task may be reassigned to another user.
•SendNotification: Indicates if an email must be sent to a user informing of the availability of the Task.
•SendAlarms: Indicates if an email must be sent to the assigned user informing that the Task is at risk of being overdue.
•ExtendedEstimatedDuration: Estimated extended time duration.
•Form: Reserved for future use.
•IsAsynchTask: Specifies if this is an asynchronous Task or no. Usually used for interfaces.
•NumberOfRetries: Applies to asynchronous Tasks. Is the number of automatic retries for the Task in case it fails (an exception is thrown).
•RetryInterval: Applies to asynchronous Tasks. Is the time (in minutes) between each retry.
•ShowFeedback: Applies to asynchronous Tasks. Indicates if the user will be informed when an error occurs.
•TimeoutSeconds: Applies to asynchronous Tasks. Time (in seconds) the asynchronous Task will wait for the external system to respond.
Output Example
SetEvent Method Output
In the following example, we illustrate a returned XML-structured response from Bizagi SOA layer, in which we can see the response of a successful invocation.
SetEventAsString Method Output
The following example shows how an error message is displayed:
Related Web methods
If you wish to execute a pending Activity instead, use the Perform Activity Web method.
For further information refer to the Perform Activity article.
To get a list of available Events for a certain case, use the Get Events Web method.
For further information refer to the Get Events article.
Last Updated 1/6/2022 5:14:13 PM