照合した古いトランザクションのアーカイブおよびアーカイブしたトランザクションのパージ

この項のスクリプトを使用して、サポートおよび調整の詳細を含めて、指定の経過期間以上経過した照合済トランザクションをアーカイブし、アーカイブしたトランザクションをAccount Reconciliationからパージします。アーカイブした照合済トランザクションはZIPファイルに記録されます。

スクリプトの仕組み

  1. input.propertiesファイル内の情報を使用して、環境にログインします
  2. 次のarchiveTmTransactionsコマンドを実行してアーカイブを作成します。生成されたZIPファイルおよびログ・ファイルでは、デフォルト名のArchive_Transactions_INTERCO_JOB_ID.zipおよびArchive_Transactions_INTERCO_JOB_ID.logが使用されます

    epmautomate archiveTmTransactions INTERCO 365 filterOperator=contains filterValue=14001

    input.propertiesファイルを変更して、コマンド・パラメータを変更できます。
  3. ログ・ファイル、およびアーカイブ済トランザクションを含む.ZIPファイルをローカル・コンピュータにダウンロードします。一致するトランザクションが見つからない場合は、スクリプトでエラー・メッセージが表示されます。
  4. アーカイブ済トランザクションを含む.ZIPファイルをOracle Object Storeにコピーします。
  5. purgeArchivedTmTransactionsコマンド(archiveTmTransactionsジョブのジョブIDを指定)を実行して、アーカイブされた照合済トランザクションをアプリケーションから削除します。

スクリプトの実行

  1. input.propertiesファイルを作成し、環境の情報を使用して更新します。ファイルをローカル・ディレクトリに保存します。このディレクトリは、ここではparentsnapshotdirectoryと呼ばれます。このファイルのコンテンツは、オペレーティング・システムによって異なります。

    このディレクトリの書込み権限があることを確認してください。Windowsの場合、スクリプトを実行できるよう、「管理者として実行」オプションを使用してPowerShellを開始する必要があります。

  2. transaction_match.ps1 (Windows PowerShell)またはtransaction_match.sh (Linux/UNIX)スクリプトを作成し、input.propertiesが配置されているparentsnapshotdirectory内に保存します。
  3. スクリプトを起動します。
    • Linux/UNIX: ./transaction_match.shを実行します。
    • Windows PowerShell: transaction_match.ps1を実行します。

input.propertiesスクリプトの作成

次のスクリプトをコピーして更新することにより、input.propertiesを作成します。

javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
epmusername=exampleAdmin1
epmpassword=examplePassword1.epw
epmurl=exampleURL1
objectstorageusername=exampleAdmin2
objectstoragepassword=examplePassword2
objectstorageurl=exampleURL2
matchtype=INTERCO
age=365
filteroperator=contains
filtervalues=FilterValue=14001
proxyserverusername=myProxyserver
proxyserverpassword=myProxyserver_pwd
proxyserverdomain=myProxyDomain

注:

Windowsのみ: 次のプロパティをinput.propertiesファイルから削除します:

  • javahome=JAVA_HOME
  • epmautomatescript=EPM_AUTOMATE_LOCATION

authentication at proxy serverがWindowsのネットワーク環境に対して有効でない場合は、次のプロパティをinput.propertiesファイルから削除します。

  • proxyserverusername
  • proxyserverpassword
  • proxyserverdomain

表3-24 input.propertiesのパラメータ

パラメータ 説明
javahome EPM自動化で使用されるJDKがインストールされているディレクトリ。Windowsバージョンのinput.propertiesからこのエントリを削除します。

例: javahome=./home/JDK/bin

epmautomatescript EPM自動化がインストールされているディレクトリ。Windowsバージョンのinput.propertiesからこのエントリを削除します。

例: epmautomatescript=./home/utils/EPMAutomate/bin

epmusername サービス管理者、または照合済トランザクションをアーカイブする権限があるパワー・ユーザーユーザーまたは参照者のユーザー名。

例: epmusername=ServiceAdmin

epmuserpassword epmusernameとして識別されるユーザーの暗号化されたパスワード・ファイル。

例: epmpassword=myPwd.epw

epmurl 照合済トランザクションがアーカイブされる環境のURL。

例: epmurl=https://test-cloudpln.pbcs.us1.oraclecloud.com

objectstorageusername Oracle Object Storage Cloudへの書込みに必要なアクセス権を持つユーザーのID。

フェデレーション・アイデンティティ・プロバイダで作成されたユーザーの場合は、ユーザーの完全修飾名を指定します(たとえば、exampleIdP/jdoeexampleIdP/john.doe@example.com。ここで、exampleIdPはフェデレーション・アイデンティティ・プロバイダの名前)。その他のユーザーの場合は、ユーザーIDを指定します。

例: epmusername=myIdP/jdoe

objectstoragepassword objectstorageusernameで識別されるユーザーに関連付けられているSwiftパスワードまたは認証トークン。このパスワードは、ユーザーがオブジェクト・ストレージ・コンソールにサインインするのに使用するパスワードとは異なります。認証トークンは、Oracleで生成されるトークンであり、たとえば、Swiftクライアントでの認証など、サード・パーティのAPIでの認証に使用します。このトークンを作成する手順は、Oracle Cloud Infrastructureドキュメント認証トークンを作成するにはを参照してください。

例: objectstoragepassword=jDoe_PWD

objectstorageurl オプションのオブジェクト名が追加されたOracle Object Storage CloudバケットのURL。

例: objectstorageurl=https://swiftobjectstorage.region_identifier.oraclecloud.com/v1/namespace/MT_Archives/2023_archives

matchtype 照合済トランザクションをアーカイブする照合タイプの識別子(TextID)。

例: matchtype=cashrecon

age

トランザクションが照合されてからの日数。この値以上経過した照合済トランザクションがアーカイブされます。

例: age=180

filteroperator アーカイブ対象の照合済トランザクションが格納されている勘定科目を識別するためのフィルタ条件。次のいずれかである必要があります: equalsnot_equalsstarts_withends_withcontainsまたはnot_contains

この値をfilterValueと組み合せて、照合済トランザクションをアーカイブする勘定科目を識別します。

例: filteroperator=not_equals

filtervalues アーカイブするトランザクションを識別する1つ以上のフィルタ値。filterOperatorとしてequalsまたはnot_equalsが指定されると、スペース区切りのリストを使用して複数の値を指定できます。複数の値が指定されている場合、フィルタ演算子とフィルタ値の組合せに一致する勘定科目のトランザクションがアーカイブ対象として選択されます。

例: filterValue=101-120 filterValue=140-202

proxyserverusername インターネットへのアクセスを制御するプロキシ・サーバーとの安全なセッションを認証するユーザー名。

例: proxyserverusername=myProxyserver

proxyserverpassword プロキシ・サーバーに対してユーザーを認証するパスワード。

例: proxyserverpassword=myProxyserver_pwd

proxyserverdomain プロキシ・サーバーに定義されているドメインの名前。

例: proxyserverdomain=myProxyDomain

Windowsスクリプト

次のスクリプトをコピーして、transaction_match.ps1を作成します。input.propertiesが格納されているフォルダに格納します。

# Archive and Purge Transaction Matching PowerShell script

$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$epmusername="$($inputproperties.epmusername)"
$epmpassword="$($inputproperties.epmpassword)"
$epmurl="$($inputproperties.epmurl)"
$objectstorageusername="$($inputproperties.objectstorageusername)"
$objectstoragepassword="$($inputproperties.objectstoragepassword)"
$objectstorageurl="$($inputproperties.objectstorageurl)"
$matchtype="$($inputproperties.matchtype)"
$age="$($inputproperties.age)"
$filteroperator="$($inputproperties.filteroperator)"
$filtervalues="$($inputproperties.filtervalues)"
$proxyserverusername="$($inputproperties.proxyserverusername)"
$proxyserverpassword="$($inputproperties.proxyserverpassword)"
$proxyserverdomain="$($inputproperties.proxyserverdomain)"

echo "Running processes to archive and purge transaction matching transactions ..."
if (${proxyserverusername}) {
    echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl} ${proxyserverusername} ${proxyserverpassword} ${proxyserverdomain}" 
    epmautomate login ${epmusername} ${epmpassword} ${epmurl} ${proxyserverusername} ${proxyserverpassword} ${proxyserverdomain} 
} else {
    echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl}" 
    epmautomate login ${epmusername} ${epmpassword} ${epmurl}
}
echo "Running epmautomate archiveTmTransactions \"${matchtype}\" ${age} filterOperator=${filteroperator} ${filtervalues}"
epmautomate archiveTmTransactions "${matchtype}" "${age}" "filterOperator=${filteroperator}" "${filtervalues}" > ./outfile.txt.tmp

$jobIdLine=Select-String -Path "outfile.txt.tmp" -Pattern "Job ID"; $jobIdLine=($jobIdLine -split ":")[-2]; $jobid=($jobIdLine -split " ")[1];
$logfile="Archive_Transactions_${matchtype}_${jobid}.log"
$transactionsfile="Archive_Transactions_${matchtype}_${jobid}.zip"
epmautomate listfiles > ./files.txt.tmp
$transactionslogfound=Select-String -Path "./files.txt.tmp" -Pattern "${logfile}"
$transactionsfilefound=Select-String -Path "./files.txt.tmp" -Pattern "${transactionsfile}"
rm ./outfile.txt.tmp
rm ./files.txt.tmp

if (${transactionslogfound}) {
    echo "Running epmautomate downloadfile \"${logfile}\""
    epmautomate downloadfile "${logfile}"
    if (${transactionsfilefound}) {
        echo "Running epmautomate downloadfile ${transactionsfile}"
        epmautomate downloadfile "${transactionsfile}" 
        if ($?) {
            echo "Running epmautomate copyToObjectStorage ${transactionsfile} ${objectstorageusername} ${objectstoragepassword} ${objectstorageurl}"
            epmautomate copyToObjectStorage "${transactionsfile}" "${objectstorageusername}" "${objectstoragepassword}" "${objectstorageurl}"
            if ($?) {
                echo "Running epmautomate purgeArchivedTMTransactions JOBID=${jobid}"
                epmautomate purgeArchivedTMTransactions "JobID=${jobid}"
            } 
            else {
                echo "EPMAutomate copyToObjectStorage failed. Purging of archived matched transactions will not be attempted."
            } 
        }
        else {
            echo "Download of transactions file ${transactionsfile} failed. Copy to object storage, and purging of archived matched transactions will not be attempted."
        }
    } 
    else {
        echo "No matched transactions found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
    }
} 
else { 
    echo "Matchtype ID \"${matchtype}\" not found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
}

echo "Running epmautomate logout"
epmautomate logout
echo "Script processing completed."

Linux/UNIXのスクリプト

次のスクリプトをコピーして、transaction_match.shを作成します。input.propertiesが格納されているフォルダに格納します。

#!/bin/sh

. ./input.properties
export JAVA_HOME=${javahome}

echo "Running processes to archive and purge transaction matching transactions..."
if [[ "${proxyserverusername}" != "" ]]
then
    echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl} ProxyServerUserName=${proxyserverusername} ProxyServerPassword=${proxyserverpassword} ProxyServerDomain=${proxyserverdomain}" 
    ${epmautomatescript} login "${epmusername}" "${epmpassword}" "${epmurl}" "ProxyServerUserName=${proxyserverusername}" "ProxyServerPassword=${proxyserverpassword}" "ProxyServerDomain=${proxyserverdomain}" 
else
    echo "Running epmautomate login ${epmusername} ${epmpassword} ${epmurl}" 
    ${epmautomatescript} login "${epmusername}" "${epmpassword}" "${epmurl}" 
fi
echo "Running epmautomate archiveTmTransactions \"${matchtype}\" ${age} filterOperator=${filteroperator} ${filtervalues}"
${epmautomatescript} archiveTmTransactions "${matchtype}" "${age}" "filterOperator=${filteroperator}" "${filtervalues}" > ./output.txt.tmp

jobid=$(grep "Job ID" ./output.txt.tmp | cut -d':' -f3 | cut -d' ' -f2)
logfile="Archive_Transactions_${matchtype}_${jobid}.log"
transactionsfile="Archive_Transactions_${matchtype}_${jobid}.zip"
${epmautomatescript} listfiles > ./files.txt.tmp
transactionslogfound=$(grep "${logfile}" ./files.txt.tmp | wc -l)
transactionsfilefound=$(grep "${transactionsfile}" ./files.txt.tmp | wc -l)
rm ./files.txt.tmp
rm ./output.txt.tmp

if [ ${transactionslogfound} -eq 0 ]
then
    echo "Matchtype ID \"${matchtype}\" not found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
else
    echo "Running epmautomate downloadfile \"${logfile}\""
    ${epmautomatescript} downloadfile "${logfile}"
    if [ ${transactionsfilefound} -eq 0 ]
    then
        echo "No matched transactions found. Archive file download, copy to object storage, and purging of archived matched transactions will not be attempted."
    else
        echo "Running epmautomate downloadfile ${transactionsfile}"
        ${epmautomatescript} downloadfile "${transactionsfile}" 
        if [ $? -eq 0 ]
        then
            echo "Running epmautomate copyToObjectStorage ${transactionsfile} ${objectstorageusername} ${objectstoragepassword} ${objectstorageurl}"
            ${epmautomatescript} copyToObjectStorage "${transactionsfile}" "${objectstorageusername}" "${objectstoragepassword}" "${objectstorageurl}"
            if [ $? -eq 0 ]
            then
                echo "Running epmautomate purgeArchivedTMTransactions JOBID=${jobid}"
                ${epmautomatescript} purgeArchivedTMTransactions "JobID=${jobid}"
            else
                echo "EPMAutomate copyToObjectStorage failed. Purging of archived matched transactions will not be attempted."
            fi
        else
            echo "Download of transactions file ${transactionsfile} failed. Copy to object storage, and purging of archived matched transactions will not be attempted."
        fi
    fi
fi

echo "Running epmautomate logout"
${epmautomatescript} logout
echo "Script processing completed."