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.
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.
Recall that when using Bizagi API, the external system is expected to send information in standard XML-structured formatting.
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:
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:
The following applies to attributes of the type Image as defined in your data model, regardless of the type of image or its extension:
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 File is not to be used. The attribute called fileName should be specified for the attribute element instead.
•Image attributes in Bizagi will contain at most 1 image.
The following syntax illustrates the section regarding how to send an image:
The following example illustrates how to upload files to Bizagi:
Notice for this example:
•The process entity is named Incident.
•This Incident 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 IncidentRegistration process.