Provide jcr persistence for jbpm knowledge service (MGNLWORKFLOW-80)

[MGNLWORKFLOW-87] Harden the processInstance persistence Created: 10/Jul/13  Updated: 12/Jul/13  Resolved: 12/Jul/13

Status: Closed
Project: Magnolia Workflow Module
Component/s: None
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Sub-task Priority: Major
Reporter: Daniel Lipp Assignee: Daniel Lipp
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Date of First Response:

 Description   

There's actually two things we have to do:
a) Change the id generation - currently we're just using the System.currentTimeMillis - what is obviously not guaranteed to be unique. We should implement something smarter there.
b) Not store all processInstances as siblings but create a structure - else we might run into performance problems



 Comments   
Comment by Espen Jervidalo [ 12/Jul/13 ]

info.magnolia.module.workflow.jbpm.persistence.JcrProcessInstanceManager#addProcessInstance

  • put context.close() in finally and baos should also be closed in a finally clause.
  • looks like the exception handling is not solid? why call baos.toByteArray if writing the context fails? shouldn't it just fail? correct me otherwise
  • newProcessInstance.setProperty(WorkflowNodeTypes.WorkItem.BYTES, new ByteArrayInputStream(newByteArray)); is deprecated

remove
info.magnolia.module.workflow.jbpm.persistence.ProcessInstanceIdGenerator mapping from module descriptor

Comment by Espen Jervidalo [ 12/Jul/13 ]

Sorry just saw you are using Components.getComponent for ProcessInstanceIdGenerator. Maybe extract an interface in that case, so you actually can replace the implementation? otherwise ignore remark

Comment by Daniel Lipp [ 12/Jul/13 ]

Thx for the hint - I actually considered that option but felt like it's overhead to introduce an interface here. The id is only used internally. In case someone really, really, wants to change it he can always overwrite JcrProcessInstanceManager#createId()

Comment by Daniel Lipp [ 12/Jul/13 ]

stop - remove has not yet been adapted to the new storage in structure

Generated at Mon Feb 12 10:06:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.