Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow config IDs not disabling with AEM 6.4 #210

Open
jhostet opened this issue Aug 17, 2018 · 0 comments
Open

Workflow config IDs not disabling with AEM 6.4 #210

jhostet opened this issue Aug 17, 2018 · 0 comments

Comments

@jhostet
Copy link

jhostet commented Aug 17, 2018

Simple code changes provided below to get grabbit to throw errors.

What version of AEM are you running?
6.4.1.0

How do you produce the issue?
Install the below packages and do a content sync.
Grabbit-7.1.4.zip
Grabbit-Apache-Sling-Login-Whitelist-1.0.zip
Grabbit-Deserialization-Firewall-Configuration-1.0.zip
Sun-Misc-Fragment-Bundle-1.0.0.zip

Does the issue occur consistently?
Yes, code specifically looks for "/etc/workflows" and AEM 6.4 moves workflow launchers to /libs/settings or /conf/global/
https://helpx.adobe.com/experience-manager/6-4/sites/deploying/using/all-repository-restructuring-in-aem-6-4.html#WorkflowLaunchers

Any additional details?
After modifying WorkflowOffTasklet and WorkflowOnTasklet to only check that config IDs were provided. In DefaultWorkFlowManager I wrapped editConfigEntry in a try catch and printed a stack trace:
com.adobe.granite.workflow.core.launcher.WorkflowLauncherImpl Error editing launcher config entry javax.jcr.AccessDeniedException: OakAccess0000: Access denied
Full stack trace can be provided.

index b8e206d..d3cc798 100644
--- a/src/main/groovy/com/twcable/grabbit/client/batch/workflows/impl/DefaultWorkFlowManager.groovy
+++ b/src/main/groovy/com/twcable/grabbit/client/batch/workflows/impl/DefaultWorkFlowManager.groovy
@@ -18,6 +18,7 @@ package com.twcable.grabbit.client.batch.workflows.impl

 import com.day.cq.workflow.launcher.ConfigEntry
 import com.day.cq.workflow.launcher.WorkflowLauncher
+import javax.jcr.RepositoryException
 import com.twcable.grabbit.client.batch.workflows.WorkflowManager
 import groovy.transform.CompileStatic
 import groovy.transform.WithWriteLock
@@ -118,6 +119,10 @@ class DefaultWorkFlowManager implements WorkflowManager {
      */
     @WithWriteLock
     private void updateConfig(final WorkflowID configId, final ConfigEntry configEntry) {
+      try {
         workflowLauncher.editConfigEntry(configId, configEntry)
+        } catch(RepositoryException e) {
+          log.debug "${e.printStackTrace()}"
+        }
     }
 }
diff --git a/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOffTasklet.groovy b/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOffTasklet.groovy
index 3013935..40c7d4b 100644
--- a/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOffTasklet.groovy
+++ b/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOffTasklet.groovy
@@ -46,7 +46,7 @@ class WorkflowOffTasklet implements Tasklet {

     @Override
     RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
-        if (!workflowConfigs || !workflowConfigs.contains("/etc/workflow") /* temporary for testing */) {
+        if (!workflowConfigs) {
             //nothing to process as there are no workflow configs for the current path
             log.info "Nothing to process..."
             return RepeatStatus.FINISHED

diff --git a/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOnTasklet.groovy b/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOnTasklet.groovy
index b540934..092cc08 100644
--- a/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOnTasklet.groovy
+++ b/src/main/groovy/com/twcable/grabbit/client/batch/steps/workflows/WorkflowOnTasklet.groovy
@@ -46,7 +46,7 @@ class WorkflowOnTasklet implements Tasklet {

     @Override
     RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
-        if (!workflowConfigs || !workflowConfigs.contains("/etc/workflow") /* temporary for testing */) {
+        if (!workflowConfigs) {
             //nothing to process as there are no workflow configs for the current path
             log.info "Nothing to process..."
             return RepeatStatus.FINISHED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant