Uploading files or images from an external application

<< 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 > URL and important notes >

Uploading files or images from an external application

Overview

Often in application to application integration scenarios, it is necessary to send files (that is, any image or document in general) as part of business information inputs.

When invoking Bizagi from an external application, this scenario is easily achieved by making use of Bizagi API, which is described at Bizagi API for external applications.

This means that web methods of Bizagi API allow you to send any business information, including files, when either creating new cases, completing activities, or triggering business events.

 

note_pin

Uploading files or images through Bizagi API applies to methods of the WorkflowEngineSOA component (e.g createCasesAsString, performActivityAsString, setEventAsString).

For more information about such methods, refer to WorkflowEngineSOA Web methods.

 

Syntax

Recall that when using Bizagi API, the external system is expected to send information in standard XML-structured formatting.

 

Files

The following applies to attributes of the type File as defined in your data model, regardless of the type of file to be used, or its extension:

 

AdvanceFilesManagement_File

 

To send files, you will need to consider the following:

The file content is expected as bytes encoded as strings in base-64.

There are some key words used as syntax for this possibility: File is an expected XML element, having an attribute called fileName.

File attributes in Bizagi can hold more than 1 file.

Therefore and when sending more than one file, you will need to repeat occurrences of the File XML element (one for each file you send).

 

The following syntax illustrates the section regarding how to send files:

<Your_entity>

 <Your_file_attribute>

         <File fileName="Attachment1.txt">[encoded_bytes_here]</File>

         <File fileName="Attachment2.txt">[encoded_bytes_here]</File>

         <File fileName="Attachment3.txt">[encoded_bytes_here]</File>

 </Your_file_attribute>

</Your_entity>

 

The following example illustrates how to upload 2 files to Bizagi:

 

SOAFileExample

 

Notice for this example:

The process entity is named MyProcess.

This MyProcess entity has a file type attribute, called Myfile (which is the one to store the uploaded file).

Overall, in this example the file is sent to Bizagi when an external application invoke the method that creates a new case of the MyProcess process using these attributes in its data model.

 

SOAProcessExample

 

Images

The following applies to attributes of the type Image as defined in your data model, regardless of the type of image or its extension:

 

AdvanceFilesManagement_Image

 

To send images, you will need to consider the following:

Just as with files, the content is expected as bytes encoded as strings in base-64.

A similar syntax as in with files is used for this possibility, though image attributes in Bizagi will contain at most 1 image.

 

The following syntax illustrates the section regarding how to send an image:

<Your_entity>

 <Your_image_attribute>

         <File fileName="MyImage.png">[encoded_bytes_here]</File>

 </Your_image_attribute>

</Your_entity>

 

The following example illustrates how to upload an image to Bizagi:

 

SOAImageExample

 

Notice for this example:

The process entity is named MyProcess.

This MyProcess entity has a file type attribute, called Myimage (which is the one to store the uploaded image).

Overall, in this example the file is sent to Bizagi when an external application invoke the method that creates a new case of the MyProcess process using these attributes in its data model.

 

SOAProcessExample


Last Updated 1/6/2022 5:12:21 PM