
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2016 11:51 AM
I'd like to create a local task variable from a TaskListener when Activiti invokes it for a "complete" event:
This code causes a SQL Exception:
Does the "complete" TaskListener event occur too late in the task's lifecycle to be adding local task variables to it? If so, is there a recommended technique for trying to do this?
public class RoutingOptionAuditor implements TaskListener { private Expression routeExpression; @Override public void notify(DelegateTask delegateTask) { String routingOption = getRoutingOption(delegateTask); // this code grabs some text from an enumerated form property value TaskService taskService = getTaskService(delegateTask); taskService.setVariableLocal(delegateTask.getId(), "routingOption", routingOption);}
This code causes a SQL Exception:
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_VAR_EXE: PUBLIC.ACT_RU_VARIABLE FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('5')"; SQL statement:delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-192]### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline### The error occurred while setting parameters### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?### Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_VAR_EXE: PUBLIC.ACT_RU_VARIABLE FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('5')"; SQL statement:delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-192]
Does the "complete" TaskListener event occur too late in the task's lifecycle to be adding local task variables to it? If so, is there a recommended technique for trying to do this?
Labels:
- Labels:
-
Archive
1 ACCEPTED ANSWER
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2017 08:26 PM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2017 08:26 PM
