AEM as a Cloud Service工作流程清除任務的設定範例
本文說明在AEM as a Cloud Service中設定工作流程清除作為維護任務的設定範例。
說明 description
環境
Adobe Experience Manager as a Cloud Service (AEMaaCS)
問題/症狀
本文是在AEM as a Cloud Service中將工作流程清除設定為維護任務的設定範例。
參考資料:
Adobe Experience Manager維護指南
解決方法 resolution
若要將工作流程清除設定為維護任務,請按照以下步驟在Maven專案中設定必要的元素:
步驟1. OSGi設定
建立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 Adobe 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環境。 請務必從較低層環境部署設定。