-
1. Re: Problem in reading Process Varibles after process is completed???
quangtin3 Dec 16, 2013 9:23 PM (in response to javalearner)Hi Rajesh,
I have the same result with the approach 1st. I think it's as designed because we're dealing with Knowledge Session. In our system, we're using approach 2nd, I will be a bit more detail here:
- To keep the jBPM engine small and running without much additional tables, we successfully managed to have almost all business states passing between nodes, rules, tasks, service tasks using only jBPM's parameter mechanic (Task Variables, Process Variables).
- For example, to support multiple file attachments we only passing the file IDs as Task parameters. We're using a separate File Repository module with an interface some things like those:
public VogAttachmentWrapper load(Integer id) { .. } public Integer store(UploadedFile file){.. }
- Using a custom made Task Form (Primefaces Extenstion's DynaForm), so It's a trivial task to display the Attachments (Preview, Download) with just the IDs.
I think We did try to pass a POJO object itself as a Process Instance Variable (when starting the process) but I just can't recall the result. I will find sometime to check the User Guide and orange an experiment.
In your approach 3th, to make the change in Exit Action persist, we need to assign it value to a Process Variable. Task Service, or Human Task in particular are simply separate engine from jBPM.
For your question hasn't had any response in 4 day, so maybe this might be help.
-
2. Re: Problem in reading Process Varibles after process is completed???
swiderski.maciej Dec 18, 2013 4:44 AM (in response to javalearner)that is expected behavior as process instance contains variables as long as it is active, once it's completed there will not be access to process variables as instance that owned them does not exist any more. As you noticed, VariableInstanceLog holds the value of variables although it's string only. So I would suggest to implement toString() method in your process variable objects that then can be read and used to create an instance of that object. For example use json to serialize it on to string and thus you would be able to recreate a readonly view of the object. json is just an example but you can use any type of format.
HTH