ドキュメント

AEM as a Cloud Serviceのワークフローパージタスクのサンプル設定

最終更新日: 2025年3月12日

この記事では、AEM as a Cloud Serviceのメンテナンスタスクとしてワークフローパージを設定するためのサンプル設定について説明します。

説明

環境

Adobe Experience Manager as a Cloud Service(AEMaaCS)

問題/症状

この記事では、AEM as a Cloud Serviceのメンテナンスタスクとしてワークフローのパージを設定するサンプル設定を説明します。

参照:
Adobe Experience Manager メンテナンスガイド

解決策

ワークフローのパージをメンテナンスタスクとして設定するには、次の手順に従って 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. メンテナンスウィンドウの設定

  1. 週別メンテナンスウィンドウノードを作成します。 パス:ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/.content.xml
    設定例 :

    <?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)にメンテナンスタスクを実行します。

  2. ワークフローのパージタスクのノードを作成します。 パス:ui.apps/src/main/content/jcr_root/apps/settings/granite/operations/maintenance/granite_weekly/granite_WorkflowPurgeTask/.content.xml
    設定例 :

    <?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."/>
    
  3. ノードインストール用のパッケージフィルターを設定します。 パス:ui.apps/src/main/content/META-INF/vault/filter.xml
    設定例 :

    <workspaceFilter version="1.0">
      ...
    <!-- Add the below line to existing settings -->
    <filter root="/apps/settings/granite/operations/maintenance/granite_weekly"/>
    </workspaceFilter>>
    
  4. filevault-package-maven-plugin フィルターを更新します。 パス:ui.apps.structure/pom.xml
    設定例 :

    <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環境にデプロイします。 必ず下位環境から設定をデプロイしてください。

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f