cancel
Showing results for 
Search instead for 
Did you mean: 

Maintaining state of object in activiti workflow

vndube
Champ in-the-making
Champ in-the-making
Hi,

We have requirement of workflow where it needs to pass through Create/Edit, QC and Approve steps.
When a creator creates a product, based on workflow definition it has to go to QC/Reviewers and then accordingly it will be forwarded to approvers. Once an approver approves the product then only the product has to be published for a use.
Similarly it applies for edit -any changes done will only be visible when it completes this cycle, otherwise last published data will be applicable.

Here we are thinking to store product object with workflow itself till it gets approved.
In this case, we are only worried, if product object contain 500 attributes, how the activiiti workflow will be efficient to manage this kind of object.

Otherwise any other design, please do suggest.

Thanks in advance.

V
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
How are you planning on storing the object in Activiti? Are you planning on using 500 variables, each representing a product-attribute? This would require 500 variables to be fetched, which isn't really a big amount for activiti, you can rest assure. Another approach is to add the product as a Serializable variable. This way, activiti only needs to store and fetch one variable. Every change you make to the variable from within the process, will be stored automatically in activiti, transparently.

vndube
Champ in-the-making
Champ in-the-making
Planned to store in Serialized form.

We are looking at other aspect like if it (product object) contains more than 500 attributes. How will it be feasible and efficient storing this kind of object in activiti workflow.

Thanks

frederikherema1
Star Contributor
Star Contributor
Serializable object is just stored as a byte array. The serializable is only fetched when needed and cached during the same Activiti contexts, so the overhead is minimal. The size of the serializable depends on the number for attributes, but I'm guessing 500 attributes will mean only o couple of Kb's, so that's perfectly fine performance-wise.

vndube
Champ in-the-making
Champ in-the-making
Thanks for your response