Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Hi everyone, I have a question about creating workflows in AEM (and automating repetitive tasks in general).
Our process to create a workflow in AEM is:
It's the steps under 7 (in red) that are killing us. To add a page you have to not just click, but navigate, 9 times to add the page. It's not uncommon for us to update 15 or more pages. We have customers in multiple countries, for example USA, Canada and Puerto Rico. Which means that we have to click [Add Content], then navigate all the way through the columns (and the navigation for each column is NOT alphabetized) to get to each page, then click the Select button, for each page under USA, then do it all over again for the Canada, then do it AGAIN for Puerto Rico. That's 9 clicks times 15 pages times 3 countries. That's enough to give anyone carpal tunnel syndrome.
So my question is:
How might we add many / multiple pages to the approval workflow without having to go through all the steps of manually selecting each page separately with the mouse in the UI, and instead just paste in the page paths?
For example:
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-1
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-2
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-3
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-4
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-5
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-6
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-7
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-8
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-9
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-10
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-11
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-12
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-13
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-14
/content/my-portal/en-us/my-department/products/my-product/v1/my-topic-15
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-1
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-2
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-3
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-4
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-5
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-6
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-7
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-8
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-9
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-10
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-11
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-12
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-13
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-14
/content/my-portal/en-ca/my-department/products/my-product/v1/my-topic-15
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-1
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-2
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-3
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-4
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-5
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-6
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-7
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-8
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-9
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-10
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-11
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-12
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-13
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-14
/content/my-portal/en-pr/my-department/products/my-product/v1/my-topic-15
Surely there has to be a better way to do this??
Or in more general terms, does AEM provide some way to create a macro or script to automate these repetitive tasks?
Any help would be much appreciated.
Vistas
Respuestas
Total de me gusta
The most common and effective AEM-native solution for automating workflows based on content changes or paths is the Workflow Launcher. This allows you to define a set of rules that, when met, automatically start a specific workflow.
Rule-Based: You can configure the launcher to start your EDP Sequential Workflow or EDP Daily Workflow when any page under a specific path (or a set of paths) is modified.
Path Granularity: You could set up launchers for the specific parent folder of all your product pages, e.g., /content/my-portal/*/my-department/products/my-product/v1. The * acts as a wildcard for the language folders (en-us, en-ca, en-pr).
Event-Driven: Instead of you initiating the process, the workflow starts automatically after a page is created, modified, or moved (the JCR Event).
Navigate to the AEM Tools menu -> Workflow -> Launchers.
Create a new Launcher configuration.
Specify the Event Type: Typically, Modified is used for content updates.
Specify the Path: Use the common parent path for your product pages, with a wildcard for the language. For example: /content/my-portal/*/my-department/products/my-product/v1.
Specify the Workflow: Select your desired workflow model (e.g., EDP Sequential Workflow).
Optional: Add Conditions: You can refine the trigger with conditions based on node types or properties, though simply using the path and modified event is often enough.
This means that as soon as a user saves an update to any of the 45 pages, the workflow is automatically started with that page as the payload.
Vistas
Respuestas
Total de me gusta
hi @grasshopper998,
If you can create a query to identify all the relevant pages, you can utilize the ACS AEM Commons Bulk Workflow Manager. This would require someone to take ownership of initiating this task, which involves a manual process that might not be ideal for your use case.
Another option could be to set up a cron job to regularly check for pages that match your query and automatically assign each found page to your approval workflow.
Here’s an example of a query to find pages where the modified date (cq:lastModified) is greater than the published date (cq:lastPublished):
SELECT * FROM [cq:Page] AS page
WHERE ISDESCENDANTNODE(page, '/content/my-portal')
AND page.[cq:lastModified] > page.[cq:lastPublished]
Vistas
Respuestas
Total de me gusta
Thanks for your reply. Very interesting - I don't know if I have the access to create a cron job as you describe, but I can check with our admins, maybe they can do that on our behalf. Thanks again.
Vistas
Respuestas
Total de me gusta
Thanks for your reply, I appreciate the step-by-step instructions, and will give this a try.
Vistas
Respuestas
Total de me gusta
Hello @grasshopper998
- You cannot directly paste a list of page paths into the workflow UI in AEM Sites. All selections must be made via the UI
- You can try to automate workflow initiation via workflow packages: create a plain text file with all your page paths, upload it to CRXDE, and use the workflow package servlet to turn it into a workflow package.
- The package can then be the payload for a standard workflow, processing all pages in one workflow instance
- You can also consider using ACS Commons Bulk Workflow Manager to start workflows on large sets of resources; allows batching with CSV or folder path input.
- Full automation is possible by custom scripting (Groovy Console, AEM Easy Content Upgrade to create workflow packages and launch workflows.
Vistas
Respuestas
Total de me gusta
Thanks for your reply.
- You cannot directly paste a list of page paths into the workflow UI in AEM Sites. All selections must be made via the UI
Yes, and that is so frustrating. A UI is okay when it comes to single items, but for business users that have a large amount of changes, it amounts to a huge waste of time. They really ought to build some shortcuts for power users who need to get a lot done and don't have time to waste clicking around endlessly with the mouse.
However thanks for suggesting several alternatives to try, I will look into these!
Thanks again to everyone who replied, your answers are much appreciated, and I am hopeful that your answers will provide a solution!
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas