Set image dynamic


My situation is

1 - I create an attribute for my entity master of process that calls 'BoletoImageTeste' and your type is 'Image'.

2- I create 2 tasks in my process, the task1 and task2.

3 - In the task1 the client put your data and click next

4 - I made an Component Library that that take this data and transform in image. So my function basically return an image.

5- In the task2, I put in the forms the control BoletoImageTeste.

6- When enter in the task2 I set in the rules the follow code:

<CompraeVenda.BoletoImageTeste> = BoletoLibrary.BoletoClass.ConvertHtmlToImage(teste);

ps: where BoletoLibrary.BoletoClass.ConvertHtmlToImage return the image

When I will test all things works but when enter in the task2 my BoletoImageTeste is not the image that I make. Have nothing.

My question is, if I made and function that return an image, How I set this Image to my image attribute?


I try to return de base64string too but doesnt work.


Dear Thiago,

According to your steps, we suggest to do some changes. Firstly, you cannot set the data of a file as you did in the sixth step, we recommend Xpath. Secondly, we recommend to add a rule on event "On exit" of the first activity instead of "On Enter" of your second activity. We have an article which helps you to solve this question. In the following article: explains step by step how to set files using Xpath. As you need only images, you need to make a very small change to the source code of the rule:


// Store the filename in the attribute set aside for this purpose

var TargetFile = UploadedFile.get(0);

var FileName = TargetFile.getXPath("FileName");


//Data taken in the activity Task1

var FileName=UploadedFile.getXPath("Data");

Note: Instead to use component, you can also publish it as Web Service and invoke it through our wizard into the script rule. Check it: regards