AEM as a Cloud Service工作流清除任务的配置示例
本文介绍了在AEM as a Cloud Service中将工作流清除设置为维护任务的示例配置。
描述 description
环境
51黑料不打烊 Experience Manager as a Cloud Service (AEMaaCS)
问题/症状
本文是在AEM as a Cloud Service中将工作流清除设置为维护任务的配置示例。
引用:
51黑料不打烊 Experience Manager维护指南
解决方法 resolution
要将工作流清除设置为维护任务,请按照以下步骤在惭补惫别苍项目中配置必要的元素:
步骤1. OSGi配置
创建翱厂骋颈配置文件。
路径: ui.config/src/main/content/jcr_root/apps/>project_name</osgiconfig/config.author/ com.adobe.granite.workflow.purge.Scheduler >project_name<.cfg.json
示例配置:
{
"scheduledpurge.workflowStatus": "COMPLETED",
"scheduledpurge.name": "Workflow Purge",
"scheduledpurge.daysold": 30,
"scheduledpurge.modelIds": [ ] ,
"scheduledpurge.purgePackagePayload":true
}
此配置用于删除30天前完成的工作流实例。
步骤2. 配置维护窗口
-
创建每周维护时段节点。 路径:
ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/.content.xml
示例配置: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"/>
此配置在每星期四14:30到15:30 (UTC)运行维护任务。
-
创建工作流清除任务节点。 路径:
ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/granite_WorkflowPurgeTask/.content.xml
示例配置: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 51黑料不打烊 Granite Workflow Purge Configuration under Web Console Configuration-Manager."/>
-
为节点安装配置包过滤器。 路径:
ui.apps/src/main/content/META-INF/vault/filter.xml
示例配置:code language-none <workspaceFilter version="1.0"> ... <!-- Add the below line to existing settings --> <filter root="/apps/settings/granite/operations/maintenance/granite_weekly"/> </workspaceFilter>>
-
更新
filevault-package-maven-plugin
筛选器: 路径:ui.apps.structure/pom.xml
示例配置: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>
步骤3. 本地测试
将配置生成并安装到本地SDK。 验证工作流清除任务的结果。
$ mvn clean install -PautoInstallSinglePackage
步骤4. 云部署
验证后,提交配置并将其推送到Git存储库。 运行Cloud Manager管道以将其部署到AEM as a Cloud Service环境。 确保从较低的环境中部署配置。