Exemplo de configuração da tarefa de limpeza de fluxo de trabalho para AEM as a Cloud Service
Este artigo explica uma configuração de exemplo para configurar a limpeza de workflow como uma tarefa de manutenção no AEM as a Cloud Service.
Descrição description
Ambiente
Adobe Experience Manager as a Cloud Service (AEMaaCS)
Problema/Sintomas
Este artigo é uma amostra de configuração para configurar a limpeza de fluxo de trabalho como uma tarefa de manutenção no AEM as a Cloud Service.
Referência:
Guia de Manutenção do Adobe Experience Manager
Resolução resolution
Para configurar uma limpeza de fluxo de trabalho como uma tarefa de manutenção, siga estas etapas para configurar os elementos necessários em seu projeto Maven:
Etapa 1. Configuração OSGi
Crie um arquivo de configuração OSGi.
Caminho: ui.config/src/main/content/jcr_root/apps/>project_name</osgiconfig/config.author/ com.adobe.granite.workflow.purge.Scheduler >project_name<.cfg.json
Exemplo de configuração:
{
"scheduledpurge.workflowStatus": "COMPLETED",
"scheduledpurge.name": "Workflow Purge",
"scheduledpurge.daysold": 30,
"scheduledpurge.modelIds": [ ] ,
"scheduledpurge.purgePackagePayload":true
}
Essa configuração permite excluir instâncias de fluxo de trabalho que foram concluídas há mais de 30 dias.
Etapa 2. Configurar a janela de manutenção
-
Crie um nó de janela de manutenção semanal. Caminho:
ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/.content.xml
Exemplo de configuração:code language-none <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:Folder" sling:configCollectionInherit="true" sling:configPropertyInherit="true" windowEndTime="15:30" windowSchedule="weekly" windowScheduleWeekdays="[ 5,5] " windowStartTime="14:30"/>Essa configuração executa a tarefa de manutenção todas as quintas-feiras das 14:30 às 15:30 (UTC).
-
Crie o nó da tarefa de limpeza de workflow. Caminho:
ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/granite_WorkflowPurgeTask/.content.xml
Exemplo de configuração:code language-none <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" sling:resourceType="granite/operations/components/maintenance/task" granite.maintenance.name="WorkflowPurgeTask" granite.task.hint="HINT: Please add workflow models to be deleted to the workflow-purge configuration, which is available under Adobe Granite Workflow Purge Configuration under Web Console Configuration-Manager."/> -
Configure um filtro de pacote para a instalação do nó. Caminho:
ui.apps/src/main/content/META-INF/vault/filter.xml
Exemplo de configuração:code language-none <workspaceFilter version="1.0"> ... <!-- Add the below line to existing settings --> <filter root="/apps/settings/granite/operations/maintenance/granite_weekly"/> </workspaceFilter>> -
Atualizar o filtro
filevault-package-maven-plugin: Caminho:ui.apps.structure/pom.xml
Exemplo de configuração:code language-none <plugin> <artifactId>filevault-package-maven-plugin</artifactId> <configuration> <filters> ... <!-- Add the below lines to existing settings --> <filter><root>/apps/settings/granite</root></filter> <filter><root>/apps/settings/granite/operations</root></filter> <filter><root>/apps/settings/granite/operations/maintenance</root></filter> <filter><root>/apps/settings/granite/operations/maintenance/granite_weekly</root></filter> </filters> </configuration> </plugin>
Etapa 3. Teste local
Crie e instale a configuração no SDK local. Verifique o resultado da tarefa de limpeza do workflow.
$ mvn clean install -PautoInstallSinglePackage
Etapa 4. Implantação na nuvem
Depois de validada, confirme e envie a configuração para o repositório Git. Execute o pipeline do Cloud Manager para implantá-lo em seu ambiente AEM as a Cloud Service. Implante a configuração dos ambientes inferiores.