12-20-2017 11:58 PM
Dear Team,
I am using activiti in my spring web application and would like to execute sql statement when the task complete. but it isn't work. please check and tell me the right way.
Thanks
12-27-2017 02:03 AM
Please check above xml file.
12-27-2017 05:38 AM
Finally i executed with static query with given below expression by you
${execution.getEngineServices().getRuntimeService().createNativeExecutionQuery().sql('UPDATE act_custom_process SET status=#{status} WHERE id=#{id}').parameter('status', 'true').parameter('id', '44').singleResult()}
Now, how can i pass dynamic fields instead of static values like 'true' and 44?
12-27-2017 06:45 AM
You can use variables to pass dynamic fields as the following expression.
${execution.getEngineServices().getRuntimeService().createNativeExecutionQuery().sql('UPDATE act_custom_process SET status=#{status} WHERE id=#{id}').parameter('status', execution.getVariable('flag')).parameter('id', execution.getVariable('id')).singleResult()}
By the way, what was the cause for not working first?
12-27-2017 07:39 AM
Thank you for your reply once again. almost i reached my requirement. please help me in this too.
Here we have assignee option with variable like ${reporting_manager}. I was set the value through my java code, instead of that how can i set that through sql without java?
12-27-2017 07:54 AM
You can set variable by the el expression as the following expression.
${execution.setVariable('reporting_manager', %Value%)}
12-28-2017 01:42 AM
Hi,
if i execute the query in java class mean listener. how can i get those data?
12-28-2017 03:57 AM
It is not possible to select from any table.
If it is an Activiti table, you can do it.
12-28-2017 04:23 AM
k now how can i get the application table data? is there any other way?
Explore our Alfresco products with the links below. Use labels to filter content by product module.