Activiti with sql not executed?

cancel
Showing results for 
Search instead for 
Did you mean: 
vamsinipun
Established Member

Re: Activiti with sql not executed?

Please check above xml file.

vamsinipun
Established Member

Re: Activiti with sql not executed?

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?

daisuke-yoshimo
Senior Member

Re: Activiti with sql not executed?

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?

vamsinipun
Established Member

Re: Activiti with sql not executed?

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?

daisuke-yoshimo
Senior Member

Re: Activiti with sql not executed?

You can set variable by the el expression as the following expression.

Activiti User Guide 

${execution.setVariable('reporting_manager', %Value%)}
vamsinipun
Established Member

Re: Activiti with sql not executed?

Hi,

if i execute the query in java class mean listener. how can i get those data?

daisuke-yoshimo
Senior Member

Re: Activiti with sql not executed?

It is not possible to select from any table.

If it is an Activiti table, you can do it.

vamsinipun
Established Member

Re: Activiti with sql not executed?

k now how can i get the application table data? is there any other way?