20:43:18.506 WARN [https-jsse-nio-8888-exec-3] io.nflow.engine.internal.dao.WorkflowInstanceDao [WorkflowInstanceDao.java : 247] - Failed to insert workflow instance
org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; Unique index or primary key violation: "PUBLIC.NFLOW_WORKFLOW_UNIQ ON PUBLIC.NFLOW_WORKFLOW(TYPE, EXTERNAL_ID, EXECUTOR_GROUP) VALUES 1"; SQL statement:
insert into nflow_workflow(type, priority, parent_workflow_id, parent_action_id, business_key, external_id, executor_group, status, state, state_text, next_activation, workflow_signal) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.NFLOW_WORKFLOW_UNIQ ON PUBLIC.NFLOW_WORKFLOW(TYPE, EXTERNAL_ID, EXECUTOR_GROUP) VALUES 1"; SQL statement:
insert into nflow_workflow(type, priority, parent_workflow_id, parent_action_id, business_key, external_id, executor_group, status, state, state_text, next_activation, workflow_signal) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200]
@RequestMapping(path = "/submitRequest", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public RequestStatus submitRequest(@RequestBody AccessRequest postBody) {
try {
RequestStatus requestStatus = accessRequestTableRepo.recordNewRequest(postBody);
workflowInstances.insertWorkflowInstance(
workflowInstanceFactory.newWorkflowInstanceBuilder().setType(DemoAccessWorkflow.TYPE)
.setExternalId("demoAccess")
.putStateVariable(DemoAccessWorkflow.REQUEST_ID, requestStatus.requestId).build());
return requestStatus;
} catch (ServiceException e) {
throw e;
} catch (Exception e) {
throw new ServiceException("Failure in submitRequest", e);
}
}
The first time I call this method I get expected results, the second and any subsequent time I call it I get the errors I mentioned previously. So I guess I am not supposed to be calling this InsertWorkflowInstance method multiple times. But then for the life of me I can't figure out how to do something as basic as implement this rest method while sharing the same workflow, not to mention wanting to do a real clustered deployment with multiple workflows running in parallel.
--
You received this message because you are subscribed to the Google Groups "nflow-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nflow-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nflow-users/45b23e09-7413-49b3-bdbe-37ab1c6d55efn%40googlegroups.com.