05-09-2017 10:22 PM
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.
05-09-2017 11:47 PM
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
05-09-2017 11:58 PM
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") )}
05-10-2017 09:40 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.