AEM 6.4 Workflow models location | Community
Skip to main content
New Participant
April 17, 2018
Solved

AEM 6.4 Workflow models location

  • April 17, 2018
  • 9 replies
  • 10574 views

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.
Best answer by arunpatidar

Hi,

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

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

9 replies

sreenu539
New Participant
November 1, 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.

arunpatidar
New Participant
October 31, 2018

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

Arun Patidar
sreenu539
New Participant
October 30, 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
New Participant
October 30, 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.

New Participant
May 9, 2018

Thanks, this is it.

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

arunpatidar
arunpatidarAccepted solution
New Participant
May 9, 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");

Arun Patidar
New Participant
May 8, 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.

Employee
May 8, 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.

marvinf30118885
New Participant
May 8, 2018

Did you try using

Also found here:

Workflow Best Practices

HeenaMadan
New Participant
June 7, 2020
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.