Categories
Bizagi Tips and Tricks

How to get the physical path of uploaded documents

Bizagi code (my version)

The below code helps you trace the location of any uploaded document in Bizagi:

var uploadPath = CHelper.getParameterValue("uploadPath");
var IdEntity = CEntityManager.GetEntity("entity-name").Id;
var IdAttribute = CEntityManager.GetEntity("entity-name").Attributes["attribute-document-name"].Id;
var SurrogateKey = <entity-name.Id>;
var WholePart = (SurrogateKey - (SurrogateKey % 1000)) / 1000;
var bizagiFilePath = uploadPath + "\\" + IdEntity+"\\"+ WholePart +"\\"+ SurrogateKey +"\\"+ IdAttribute;