Hi,
I am using trial version of APS v1.6.1.
I though want to try to create a service task that to do a simple calculation based on 2 input number from earlier user task. For example I have 2 number fields, A and B that user will need to input the numbers. In this service task, I just want to have result from A + B. Not too sure how to do this. Still goggling.
Thanks.
Hi Tham,
This post https://community.alfresco.com/community/bpm/blog/2016/11/15/activiti-enterprise-developer-series-se... will be a good start for you. More details about the usage of service tasks and script tasks can be found at APS Documentation & Activiti User Guide: Script Task. For something as simple as a sum of two variables, script task/expression will be the easiest. Attached is a sample app, calculating the sum of two variables (var1 + var2) and displaying the output in a form (via a variable named 'var3').
Hope this helps.
Ciju
If it is not necessary to explicitly indicate calculation process on the process diagram, you can use task listener(Expression).
Setting task listener on 'Apply' user task as following.
・Event
complete
・Type
・Expression
${task.setVariable("C", task.getVariable("A") + task.getVariable("B") )}
If it is necessary to explicitly indicate calculation process on the process diagram, you can use service task(Expression).
Setting service task as following.
・Task Type
Expression
・Expression
${execution.setVariable("C", execution.getVariable("A") + execution.getVariable("B") )}
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.