RE: How to enable workflow for a specific language in journal article

thumbnail
Nader Jafari, modified 6 Years ago. Junior Member Posts: 84 Join Date: 8/24/11 Recent Posts
Hi guys
we need to enable workflow when a specific translate will be added to article or when an user will be changed the translate for a specific language.
How could we do this In liferay?
How to detect this change in workflow definition?
Thank you
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Nader Jafari:

we need to enable workflow when a specific translate will be added to article or when an user will be changed the translate for a specific language.

As you can have workflow only for all or no article in a site, you'd have to create a custom workflow that is aware of the language of an article and uses an automatic (scripted) assignment of the next workflow steps depending on the edited language.
thumbnail
Nader Jafari, modified 6 Years ago. Junior Member Posts: 84 Join Date: 8/24/11 Recent Posts
Thank you Olaf
my question is that does liferay have an API to detect that the content of an article changed on a specific language?
it is so hard to detect this changes in script because the localized fields have XML content in database and for this detection we need to pars content of these fileds (Title,Description,Content).
My requirement is that we need several article approvers for each language ,not single approver for all artilces.
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
I'm not aware of a specific API. You probably will have to fetch the previous version's content, diff for yourself, and determine what's changed.
An alternative would be to add metadata during editing, e.g. while saving calculate some hints for the workflow system and rely on that data to go through the workflow.  That would keep the messy part out of the workflow definition.
I'd recommend to utilize custom APIs in general for this purpose: Instead of messing with a lot of script code in the workflow definition, limit the script code to call your custom APIs - you'll have a lot better story there in debugging and deployment, IMHO. At least compare the options of script vs custom API.