03-22-2021 05:07 PM
We have a custom doctype that was using the Nuxeo "default" lifecycle. We found that we didn't like the states of "project," "approved," and "obsolete," so we created a new custom lifecycle called "simple" with the states of "active" and "inactive." After reading documentation, we find that only newly created documents will have the "simple" lifecycle, with existing documents retaining "default."
How can we update all the existing documents that have the old lifecycle, to now use the new one? I've seen references to using "Document.FollowLifecycleTransition", but that doesn't seem to work since it would still only follow the transitions of default. Ideally we would like to use an API call (bulk automation), but I have not yet found anything I could make work.
It seems like my only options are CoreSession.reinitLifeCycleState
and Document.FollowLifecycleTransition
, but I hope I'm just overlooking something. it would be nice if reinitLifeCycleState
would reset the lifecycle to the new one, but I don't think that is how it works.
These are the related questions I've found, but none seem to be asking for the same thing as we need: https://answers.nuxeo.com/general/q/1c370e212dea46fba65903e63f237c16/CMIS-change-nuxeo-lifecycleStat... https://answers.nuxeo.com/general/q/36056e9d30ea481c9c154056627caa29/Can-i-change-Life-Cycle-State-t... https://answers.nuxeo.com/general/q/2cbffb4ccc9f4eb9810bd9f37cdd4682/Not-able-to-change-state-of-doc... https://answers.nuxeo.com/general/q/86199415a6274b2b911a284c5fe44974/Can-I-set-the-Current-Life-Cycl...
03-30-2021 12:47 PM
Hello. I don't think this is something we support OOTB. The only possible think I guess is to use the same transition name.
04-01-2021 04:47 PM
Yeah, there doesn't seem to be a way to do this OOTB. I haven't tried using a same transition name, since there would be a bit of work customizing the new lifecycle to have extra states/transitions to accommodate the attempt (and afterwards removing them). Support gave me some guidance on some possible Java contribution, but it seems the easiest is to just update the database values as needed. We are cloud so we don't have access to do that (although we could request for it to be done I suppose). Anyway, unless things change to add a feature OOTB, then it is best to plan lifecycles well when architecting the content model so that you don't have to change it later and run into these problems.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.