Quasi-concurrent Java methods invocation in D2 Lifecycle?
Hi everyone,
I'm dealing with an annoying problem with Documentum D2 22.2.
I have a Lifecycle which, for a certain status, launches two custom Java methods, in sequence, let's say MethodA and MethodB both applied to the same document object (they are configured in the Action of the Lifecycle state).
MethodA performs a series of operations, updates a field and saves the document object.
MethodB uses the newly modified field to perform other tasks that do not require another save of the document object.
I was convinced that by configuring the two methods in the Lifecycle, they were executed with a kind of FIFO queue, instead I realized that MethodB is invoked before MethodA terminates.
The result is that MethodB does not see the field modified by MethodA and therefore does not work correctly.
I tried to interpose some non-impactful change between the invocations of the two methods (e.g. the reapplying of security or the fake modification of a field).
In fact, by doing so, the execution of the two methods appears separate but another error emerges which seems to indicate a concurrence of modifications on the same document object (DM_OBJ_MGR_E_VERSION_MISMATCH); it is as if MethodA and the interposed modification try to modify the document object at the same time, thus making MethodA fail.
Does anyone have an advice on how to make the execution of the two methods invoked by the Lifecycle strictly sequential?
Thanks in advance.