[
https://jira.jboss.org/browse/JBPM-2792?page=com.atlassian.jira.plugin.sy...
]
Huisheng Xu updated JBPM-2792:
------------------------------
Fix Version/s: jBPM 4.x
Data manipulation with HQL / SQL nodes
--------------------------------------
Key: JBPM-2792
URL:
https://jira.jboss.org/browse/JBPM-2792
Project: jBPM
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.x
Reporter: Peter Horvath
Fix For: jBPM 4.x
Currently HQL / SQL nodes only allow you to run queries. It would be great if it was
possible to run data manipulation operations (INSERT / UPDATE / DELETE) as well.
It should be quite easy to implement this by adding a new possible flag to the hql / sql
node and calling org.hibernate.Query.executeUpdate() from
org.jbpm.jpdl.internal.activity.HqlActivity.perform(OpenExecution) method:
public class HqlActivity extends JpdlAutomaticActivity {
// ...
public void perform(OpenExecution execution) {
// ...
if(isUpdate) { // isUpdate: this a new flag that indicates that this is a data
manipulation operation
// execute update and store the number of entities / rows affected (inserted, updated or
deleted) by this operation into the result variable
result = q.executeUpdate();
} else { if (isResultUnique) {
result = q.uniqueResult();
} else {
result = q.list();
}
}
// ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira