Save Activity

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Bizagi from external applications > Bizagi API > Alternative SOAP services > Available SOAP web services > WorkflowEngineSOA Web methods >

Save Activity

Overview

This Web method is used to save the entered information in a pending Activity (those found at the Inbox) from an external application.

Through this method, the Activity is not completed (clicked on Next) as with the performActivityAsString Web method.

Instead, this method simulates as if clicking Save on that Activity (hence, it is also useful to allow Bizagi run the business rules configured at the on Save Activity actions).

 

This method receives a single input having mainly: The information of the end user saving the Activity progress, the specific Process instance to be worked on (case number), the given Task name representing the pending Activity, and any business information relevant to save into that Activity (any data, attachments, etc).

Through this method, a pending Activity's progress is saved, 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 saveActivity method, the request and response XML's are of the native .NET XmlDocument type.

For the saveActivityAsString 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="ActivityData">

         <xs:complexType>

           <xs:choice>

             <xs:sequence>

               <xs:element name="radNumber" type="xs:string" />

               <xs:element name="taskName" type="xs:string" />

             </xs:sequence>

             <xs:sequence>

               <xs:element name="idCase" type="xs:string" />

               <xs:element name="idWorkItem" type="xs:string" />

             </xs:sequence>

           </xs:choice>

         </xs:complexType>

       </xs:element>

       <xs:element name="Entities">

         <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 register as the one saving information for the Activity.

userName: Name of the user who will be register as the one saving the information.

ActivityData: Contains all the necessary information to find the Activity.

radNumber: It is the creation number (case number) of the case containing the pending Activity where the data will be saved. This element is required.

taskName: The name of the pending Activity in which the information will be saved.

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 complete the Activity with Task name = Task3, for the case number having identifier = 9301.

We suggest you use How to start a process in Bizagi from other applications as a guideline to invoke this service.

 

SaveActivity Method Input

<BizAgiWSParam>
  <domain>domain</domain>
  <userName>Raulp</userName>
  <ActivityData>
    <radNumber>9301</radNumber>
    <taskName>Task3</taskName>
  </ActivityData>
  <Entities>
    <idRequest>
        <Applicants>
          <Applicant businessKey="DocumentNumber = '123456'">
              <BuroScore>180</BuroScore>
          </Applicant>
        </Applicants>
    </idRequest>
  </Entities>
</BizAgiWSParam>

 

SaveActivityAsString Method Input

<activityInfo>
  <![CDATA[<BizAgiWSParam>
    <domain>domain</domain>
    <userName>Raulp</userName>
    <ActivityData>
        <radNumber>9301</radNumber>
        <taskName>Task3</taskName>
    </ActivityData>
    <Entities>
        <idRequest>
          <Applicants>
              <Applicant businessKey="DocumentNumber = '123456'">
                <BuroScore>180</BuroScore>
              </Applicant>
          </Applicants>
        </idRequest>
    </Entities>
  </BizAgiWSParam>]]>
</activityInfo>

 

note_pin

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>
<idRequest>
    <Applicants>
      <Applicant businessKey="DocumentNumber = '123456'">
          <DocumentNumber>123456</DocumentNumber>
          <BuroScore nil="true"></BuroScore>
      </Applicant>
    </Applicants>
</idRequest>
</Entities>

 

note_pin

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="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:schema>

 

Output Parameters

process: This element includes information for the 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.

processCreationDate: Case creation date.

processSolutionDate: Case solution (closure) date.

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).

workflowClassSupportScopes: Indicates is the Process supports long-term transactions in Bizagi (Scopes); which is an efficient method of data persistence.

processError: If the Process of saving the Activity 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 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 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.

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

 

SaveActivity 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.

 

SaveActivity_Image004

 

SaveActivityAsString Method Output

The following example shows how an error message is displayed:

 

saveActivityAsString_01

 

Related Web methods

To get a list of pending Activities for a certain case, use the Get Activities Web method.

For further information refer to the Get Activity article.

 

If you wish to completely execute the pending Activity (similarly to this method, but actually moving forward in the workflow by advancing the Activity), use the Perform Activity Web method.

For further information refer to the Perform Activity article.


Last Updated 1/6/2022 5:14:09 PM