AEM 6.4 Workflow models location

dzmitryk7401781

17-04-2018

Hi,

I am trying to programmatically start workflow instance based on a particular model.

Here is a sample code which would work in AEM 6.2:

WorkflowModel wfModel = wfSession.getModel("/etc/workflow/models/dam/update_asset/jcr:content/model")

//...

wfSession.startWorkflow(wfModel, wfData)

Now, it seems like workflows were refactored in 6.4, and according to Workflow Best Practices I should find workflow models at /libs/settings/workflow/models/

Under this path there is indeed something that looks like model definition (although named 'flow'), but it's not exactly what getModel method accepts as a valid model path.

So the question is simple: what path I should supply in order to instantiate WF model?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Arun_Patidar

MVP

08-05-2018

Hi,

To start workflow, you need to get model from var folder i.e.

WorkflowModel wfModel = wfSession.getModel("/var/workflow/models/request_for_activation");

Answers (8)

Answers (8)

marvinf30118885

08-05-2018

Did you try using

Also found here:

Workflow Best Practices

sreenu539

31-10-2018

yes admin/admin. I have even disabled all custom launcher configs that didn't help. took out all the custom workflows models from conf/global, var/workflow that either didn't help.

sreenu539

30-10-2018

Upgrading to AEM 6.4.2

I saw javax.jcr.AccessDeniedException: OakAccess0000: Access denied once I deploy client application code on 6.4.2

then I tried following but didn't help much.

Fresh aem 6.4.2

localhost:4502/aem/start -> assets -> files -> file upload  ---- worked

install client application code (worked in 6.2 aem) - deployed on aem 6.4.2

file upload --- not working. - image is blank.

What I did : edit and sync workflows -> generated client application custom workflows  in new folder structure /conf/global, var/workflow

made code restructuring of etc/workflows into /conf/global, var/workflow

changed references in client application custom workflow from /etc/workflow -> libs/settings/workflows, libs/workflow/scripts/, conf/global, var/workflow ../request_for_activation

I do see instances of upload_asset running in localhost:4502/workflow, I do not see errors ( access denied errors) in error.log file.

I do not see image uploaded though. it is blank. - Any ideas??

sreenu539

30-10-2018

AEM 6.4.2

I do not see my application custom workflows at http://localhost:4502/libs/cq/workflow/content/console.html  why ?

I have custom workflows code below - /conf/global/settings/workflow/dam/my-dam/ ....

I have changed code references in content.xml files of workflows

FROM  workflow="/etc/workflow/models/dam/my-dam/dam-assets-custom-writeback/jcr:content/model"/ >

TO   workflow="/conf/global/settings/workflow/models/dam/my-dam/dam-assets-custom-writeback/jc r:content/model"/>

I do not see any node called "model" below "/conf/global/settings/workflow/models/dam/my-dam/dam-assets-custom-writeback/jcr:content "

please help me.

dzmitryk7401781

08-05-2018

Hi,

Neither of those locations acceptable for wfSession.getModel method. So it does not solve problem, even though documentation states those are locations for the models.

Kunwar

Employee

08-05-2018

Starting 6.4, all OOTB workflows would be under /etc/workflow/models but any change you do in these OOTB models, would create an overlaid models under /conf folder

This would be helpful down the line once you upgrade to newer version of AEM and there won't be any dependency on adjusting/repackaging your workflow as apart of pre-upgrade process. Custom workflows would be migrated from /conf with ease.