Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM 6.4 Workflow models location

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

10 Replies

Avatar

Community Advisor
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.

Avatar

Employee

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.

Avatar

Level 2

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.

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2

Thanks, this is it.

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

Avatar

Level 7

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.

Avatar

Level 7

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

Avatar

Community Advisor

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



Arun Patidar

Avatar

Level 7

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.