cancel
Showing results for 
Search instead for 
Did you mean: 

Stencil value not getting stored

amruta_w
Star Collaborator
Star Collaborator

Hello,

I have created simple stencil with text box for an example. here i am facing some problem like if i have entered any value for the stencil text box the value is not getting stored in database, after completing of the task that value will not be present.

Here I have attached the my app, kindly anyone help me out in this regard.

Thanks

Amruta 

1 ACCEPTED ANSWER

cjose
Elite Collaborator
Elite Collaborator

Checkout this example activiti-examples/stencil-samples/simple-text-input-stencil at master · cijujoseph/activiti-examples... , especially the controller code which does things like onFormRender and others.. It is an app zip and the stencil gets imported along with the app if you import my example app.

View answer in original post

11 REPLIES 11

hari
Star Contributor
Star Contributor

I tested your process and I could see that the variables are saved as expected. My guess is that you are looking into act_ru_variables. When the process completes, your variables will be present in act_hi_varinst. 

amruta_w
Star Collaborator
Star Collaborator

‌ but for me it is not working, the textbox will be blank.

hari
Star Contributor
Star Contributor

Hi, 

Your process has two user tasks. Below are the screenshots of the completed process at my end. 

User Task 1

The reason why your 1st text box is empty is because you are refering it to a variable called label. Where as your second one is referred with a variable name "name". 

User Task 2

amruta_w
Star Collaborator
Star Collaborator

the Name text box is APS default textbox but mine is label textbox, see in your screen shot also not saved

hari
Star Contributor
Star Contributor

I can see things working as expected. I think you should look at your own form designs and the way you want them. The reason why it is empty is because we did not give any value to it. 

amruta_w
Star Collaborator
Star Collaborator

‌ you fill it and check, then you may address where i am facing the problem.

hari
Star Contributor
Star Contributor

I get you now. Yes it was not saved. 

hari
Star Contributor
Star Contributor

There was a blog witten by Ciju Joseph‌ on Stencils here https://community.alfresco.com/community/bpm/blog/2017/05/01/form-stencil-examples-alfresco-process-... . I can see an example of a simple form stencil which I can see as working as per our context here (Its persisting the data of the field) . The only difference is in the Form runtime template. 

‌ can you please help us understand a bit more on the form runtime template ? 

amruta_w
Star Collaborator
Star Collaborator

Yeah those examples are working, it worked for me too..

A RUNTIME template means after you publish the process whats the appearance and you need to write angular 1 code according to the requirement. EDITOR template means at the design time how it should appear. You can go through the example more.