AEM 6.4 Workflow models location | Community
Skip to main content
Level 2
Apr 17, 2018 10:31 PM UTC
Solved

AEM 6.4 Workflow models location

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
May 9, 2018 12:13 AM UTC

Hi,

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

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

Arun Patidar

10 replies

sreenu539
Level 7
Nov 1, 2018 6:36 AM UTC

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.

Translate
arunpatidar
New Participant
Oct 31, 2018 7:43 AM UTC

Are you running this as admin? If yes then there could be issue with upgrade.

Translate
Arun Patidar
sreenu539
Level 7
Oct 30, 2018 6:21 PM UTC

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??

Translate
sreenu539
Level 7
Oct 30, 2018 6:20 PM UTC

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.

Translate
Level 2
May 9, 2018 12:39 AM UTC

Thanks, this is it.

I wonder what is the reason to put models there, never would be looking for it under var.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
May 9, 2018 12:13 AM UTC

Hi,

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

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

Translate
Arun Patidar
Level 2
May 8, 2018 10:29 PM UTC

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.

Translate
Employee
May 8, 2018 2:14 PM UTC

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.

Translate
marvinf30118885
New Participant
May 8, 2018 2:04 PM UTC

Did you try using

Also found here:

Workflow Best Practices

Translate
HeenaMadan
New Participant
Jun 7, 2020 9:57 AM UTC
Created workflow models save at this location /conf/global/settings/workflow/models and OOTB models saved at /libs/settings/workflow/models location in newer AEM version.
Translate