> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XML Group Connector

> Group and aggregate collections of related XML records by key fields, with support for MIN, MAX, SUM, AVG, COUNT, and CONCATENATE functions.

export const NameDescription = ({extraRows}) => <table>
    <thead>
      <tr>
        <th>設定</th>
        <th>説明</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><strong>Connector Id</strong></td>
        <td>コネクタの静的で一意の識別子です。</td>
      </tr>
      <tr>
        <td><strong>Connector Type</strong></td>
        <td>コネクタ名とその機能の説明を表示します。</td>
      </tr>
      <tr>
        <td><strong>Connector Description</strong></td>
        <td>コネクタおよびフロー内でのその役割について自由形式の説明を提供するためのオプションフィールドです。</td>
      </tr>
      {extraRows}
    </tbody>
  </table>;

export const SlasTab = ({siteName = "CData Arc"}) => <>
    <p><em>サービスレベルアグリーメント（SLA）の設定に関する設定です。</em></p>
    <p>
      SLA を使用すると、フロー内のコネクタが送受信すると見込まれるボリュームを設定し、そのボリュームを達成すると見込まれる期間を設定できます。{siteName} は、SLA が達成されない場合にユーザーへ警告するメールを送信し、SLA を<em>At Risk</em> としてマークします。これは、SLA が間もなく達成されない場合に<em>Violated</em> としてマークされることを意味します。これにより、ユーザーは介入してSLA が達成されない理由を特定し、適切な対応を取る機会を得られます。At Risk 期間の終了時点でもSLA が達成されない場合、SLA はviolated としてマークされ、ユーザーに再度通知されます。
    </p>
    <p>
      SLA を定義するには、<strong>Expected Volume</strong> をオンに切り替え、<strong>Settings</strong> タブをクリックします。
    </p>
    <img src="/public/images/sla_empty.png" alt="SLA Empty" />
    <ul>
      <li>コネクタに送信と受信の個別のアクションがある場合は、ラジオボタンを使用してSLA がどちらの方向に適用されるかを指定します。</li>
      <li>ウィンドウの<strong>Expect at least</strong> 部分で、次を設定します。
        <ul>
          <li>処理を見込む最小トランザクション数（ボリューム）を設定します。</li>
          <li><strong>Every</strong> フィールドを使用して期間を指定します。</li>
          <li>SLA を有効にするタイミングを指定します。<strong>Starting on</strong> を選択した場合は、日付および時刻フィールドを入力します。</li>
          <li>SLA を有効にしたい曜日のチェックボックスをオンにします。必要に応じて、ドロップダウンで<strong>Everyday</strong> を選択します。</li>
        </ul>
      </li>
      <li>ウィンドウの<strong>Set status to 'At Risk'</strong> 部分で、SLA をAt Risk としてマークするタイミングを指定します。
        <ul>
          <li>デフォルトでは、SLA が違反状態になるまで通知は送信されません。これを変更するには、<strong>Send an 'At Risk' notification</strong> をオンにします。</li>
        </ul>
      </li>
    </ul>
    <p>
      次の例は、月曜日から金曜日まで毎日1000 件のファイルを受信すると見込むコネクタ向けに設定されたSLA を示しています。1000 件のファイルが受信されていない場合、期間の終了の1時間前にAt Risk 通知が送信されます。
    </p>
    <img src="/public/images/sla_defined.png" alt="SLA Configuration Example" />
    <Note>
      必要に応じてSLA アラートをオフにすることができます。これはメンテナンスウィンドウ中に役立ちます。navbar で<strong>Settings</strong> をクリックし、<strong>Alerts &gt; General Alerts</strong> に移動します。タブレットと鉛筆のアイコンをクリックして編集し、<strong>SLA Alerts</strong> 設定のチェックを外します。
    </Note>
  </>;

export const AlertsTab = ({siteNameShort = "Arc"}) => <>
    <p><em>アラートの設定に関する設定です。</em></p>
    <p>
      サービスレベルアグリーメント（SLA）を実行する前に、通知用のメールアラートをセットアップする必要があります。デフォルトでは、{siteNameShort} は<a href="/26.3/cloud/ja/getting-started/administration/settings/alerts">Alerts</a> タブのグローバル設定を使用します。このコネクタに別の設定を使用するには、<strong>Override global setting</strong> をオンに切り替えます。
    </p>
    <p>
      デフォルトではエラーアラートが有効になっており、エラーが発生するたびにメールが送信されます。これをオフにするには、<strong>Enable</strong> チェックボックスのチェックを外します。
    </p>
    <p>
      <strong>Subject</strong>（必須）を入力します。<strong>Allow {siteNameShort}Script in Subject</strong> をチェックすると、<strong>Subject</strong> フィールドで{siteNameShort}Script を使用できます。これを選択すると、<strong>{siteNameShort}Script エディタ</strong>ボタンが表示されます（<img src="/public/images/rest_arcscript_editor.png" alt="arcscript editor button" style={{
  display: 'inline',
  verticalAlign: 'middle',
  margin: 0
}} />）。
    </p>
    <p>
      必要に応じて<strong>Recipient</strong> のメールアドレスをカンマ区切りのリストで入力します。
    </p>
  </>;

export const MiscConnector = () => <>
    <p><em>Miscellaneous 設定は、特定のユースケース向けの設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Other Settings</strong></td>
          <td>非表示のコネクタ設定をセミコロン区切りのリストで設定できます（例：<code>setting1=value1;setting2=value2</code>）。通常のコネクタのユースケースや機能では、これらの設定の使用は必要ありません。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const Logging = () => <>
    <p><em>ログの作成と保存を制御する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Log Level</strong></td>
          <td>コネクタが生成するログの詳細度です。サポートを依頼する際は、これを<strong>Debug</strong> に設定してください。</td>
        </tr>
        <tr>
          <td><strong>Log Subfolder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタがLogs フォルダ内のファイルをグループ化するよう指示します。<strong>Weekly</strong> オプション（デフォルト）は、コネクタが毎週新しいサブフォルダを作成し、その週のすべてのログをそのフォルダに保存するよう指示します。この設定を空白のままにすると、コネクタはすべてのログをLogs フォルダに直接保存します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでログを整理しやすくなり、パフォーマンスが向上します。</td>
        </tr>
        <tr>
          <td><strong>Log Messages</strong></td>
          <td>処理したファイルのログエントリにファイル自体のコピーを含めるには、これをオンにします。これを無効にすると、<strong>Transactions</strong> タブからファイルのコピーをダウンロードできなくなる場合があります。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MacrosExamples = ({extraMacros = []}) => <>
    <p>
      %Ext% や %ShortDate% などの一部のマクロは引数を必要としませんが、引数を必要とするものもあります。
      引数を取るすべてのマクロは次の構文を使用します。<code>%Macro:argument%</code>
    </p>

    <p>引数を取るマクロの例を次に示します。</p>

    <ul>
      <li>%Header:headername%：<code>headername</code> はメッセージ上のヘッダーの名前です。</li>
      <li>%Header:mycustomheader% は、入力メッセージに設定された<code>mycustomheader</code> ヘッダーの値に解決されます。</li>
      <li>%Header:ponum% は、入力メッセージに設定された<code>ponum</code> ヘッダーの値に解決されます。</li>
      <li>%RegexFilename:pattern%：<code>pattern</code> は正規表現パターンです。例えば、<code>%RegexFilename:^([\w][A-Za-z]+)%</code> は、ファイル名の最初の単語にマッチしてそれに解決され、大文字・小文字を区別しません（<code>test_file.xml</code> は<code>test</code> に解決されます）。</li>
      <li>%Vault:vaultitem%：<code>vaultitem</code> は<a href="/26.3/cloud/ja/getting-started/administration/settings/global-settings-vault">Vault</a> 内のアイテムの名前です。例えば、<code>%Vault:companyname%</code> は、Vault に保存された<code>companyname</code> アイテムの値に解決されます。</li>
      <li>%DateFormat:format%：<code>format</code> は許容される日付形式です（詳細は<a href="/26.3/cloud/ja/scripting/value-formatters/date-formatters#sample-date-formats">日付形式のサンプル</a>を参照してください）。例えば、<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code> は、ファイルの日付とタイムスタンプに解決されます。</li>
      {extraMacros.filter(item => item.example).map(item => <li key={`ex-${item.name}`}>{item.example}</li>)}
    </ul>

    <p>次の例に示すように、より高度なマクロを作成することもできます。</p>

    <ul>
      <li>1 つのファイル名で複数のマクロを組み合わせる：<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%</code></li>
      <li>マクロの外側にテキストを含める：<code>MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code></li>
      <li>マクロの内側にテキストを含める：<code>%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%</code></li>
    </ul>
  </>;

export const MacrosTable = ({siteName = "CData Arc", extraMacros = []}) => <>
    <p>
      ファイル命名戦略でマクロを使用すると、データの整理効率と文脈の理解を高めることができます。
      ファイル名にマクロを組み込むことで、識別子、タイムスタンプ、ヘッダー情報などの関連情報を
      動的に含めることができ、各ファイルに有用な文脈を提供します。
    </p>

    <p>{siteName} は次のマクロをサポートしています。これらはすべて次の構文を使用します。<code>%Macro%</code></p>

    <table>
      <thead>
        <tr><th>マクロ</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr><td>ConnectorID</td><td>コネクタのConnectorID に評価されます。</td></tr>
        <tr><td>ConnectorName</td><td>コネクタの名前に評価されます。ファイル名やパスに接続名を含めることができます。例えば、どのデータベース接続が生成したかによってバックアップファイルにタグを付けるために使用できます。</td></tr>
        <tr><td>Ext</td><td>コネクタが現在処理しているファイルの拡張子に評価されます。</td></tr>
        <tr><td>Filename</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を含む）に評価されます。</td></tr>
        <tr><td>FilenameNoExt</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を除く）に評価されます。</td></tr>
        <tr><td>MessageId</td><td>コネクタが出力しているメッセージのMessageId に評価されます。</td></tr>
        <tr><td>RegexFilename:<em>pattern</em></td><td>コネクタが現在処理しているファイルのファイル名に正規表現パターンを適用します。</td></tr>
        <tr><td>Header:<em>headername</em></td><td>コネクタが現在処理しているメッセージ上の対象ヘッダー（<code>headername</code>）の値に評価されます。</td></tr>
        <tr><td>LongDate</td><td>システムの現在の日時を長い形式（例：Wednesday, January 24, 2024）で評価します。</td></tr>
        <tr><td>ShortDate</td><td>システムの現在の日時をyyyy-MM-dd 形式（例：2024-01-24）で評価します。</td></tr>
        <tr><td>DateFormat:<em>format</em></td><td>システムの現在の日時を指定された形式（<code>format</code>）で評価します。利用可能な日時形式については、<a href="/26.3/cloud/ja/scripting/value-formatters/date-formatters#date-formats-with-literal-characters">日付形式のサンプル</a>を参照してください。</td></tr>
        <tr><td>Vault:<em>vaultitem</em></td><td>指定されたVault アイテムの値に評価されます。</td></tr>
        {extraMacros.map(item => <tr key={item.name}>
            <td>{item.name}</td>
            <td>{item.description}</td>
          </tr>)}
      </tbody>
    </table>
  </>;

export const Performance = () => <>
    <p><em>コネクタへのリソースの割り当てに関する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Max Workers</strong></td>
          <td>このコネクタでファイルを処理するためにスレッドプールから消費されるワーカースレッドの最大数です。設定すると、<a href="/26.3/cloud/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.3/cloud/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
        <tr>
          <td><strong>Max Files</strong></td>
          <td>コネクタに割り当てられた各スレッドが送信するファイルの最大数です。設定すると、<a href="/26.3/cloud/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.3/cloud/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const siteNameShort = "Arc";

export const siteName = "CData Arc";

The XML Group connector processes collections of related XML records, grouping them by columns for efficient data management and analysis.

## Key Capabilities

* Hierarchical XML record grouping and aggregation with key-based grouping and multiple grouping keys
* Aggregate function support (MIN, MAX, SUM, AVG, COUNT, and CONCATENATE) with XPath-based identification
* Preserves original record structure while adding summary and grouping elements

## Overview

The XML Group connector processes collections of related XML records by aggregating, validating, and transforming structured data for seamless integration with various systems. It enables efficient handling of hierarchical XML data, ensuring consistency and interoperability across applications such as data exchange, reporting, and automated workflows.

## Connector Configuration

This section contains all of the configurable connector properties.

### Group Config Tab

*Settings related to configuring the group.*

#### Sample File

*Use the **Sample File** toggle to specify a sample file that allows the connector to provide more context about the document. See [Using Sample Files](#using-sample-files) for more information.*

| Setting         | Description                                          |
| --------------- | ---------------------------------------------------- |
| **Sample File** | Select an existing sample file, or upload a new one. |

#### Loop Settings

*Settings related to the XPath the connector should use to represent a single record in the input document, as well as the XML element to use to hold each group of related records.*

| Setting          | Description                                                             |
| ---------------- | ----------------------------------------------------------------------- |
| **Element Name** | The name of the XML element to use for the grouping in the output file. |
| **Record XPath** | Which XPath from the input should represent a single record.            |

#### Group Settings

*Settings that define which elements in each record to use to determine the key for each group. See [Using Group Settings](#using-group-settings) for more information.*

| Setting           | Description                                                                                                                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Element Name**  | Tells the connector what to name the XML element to use for grouping in the output file. This is usually the same name as the element in the input file that the Key XPath points to, but you can use a different name. |
| **Key XPath**     | The XPath from the input file of the element to use as the *key* (what you want to group by). The **Key XPath** is relative to the **Record XPath**.                                                                    |
| **Add Key XPath** | Click this button to define additional keys.                                                                                                                                                                            |

#### Summary Settings

*Use the **Summary Settings** toggle to see the settings that define how to summarize the records in each group. See [Using Summary Settings](#using-summary-settings) for more information.*

| Setting                 | Description                                                                                   |
| ----------------------- | --------------------------------------------------------------------------------------------- |
| **Element Name**        | The name of the XPath to use to summarize the records.                                        |
| **Function**            | The function to use as the aggregate. Choose from MIN, MAX, SUM, AVG, COUNT, and CONCATENATE. |
| **XPath**               | The relative XPath to the element to aggregate.                                               |
| **Add Aggregate XPath** | Click this button to add more aggregate XPaths.                                               |

#### Order By Settings

*Use the **Order By** toggle to see the settings that define how to sort the records in each group.*

| Setting                | Description                                       |
| ---------------------- | ------------------------------------------------- |
| **XPath**              | The relative XPath to the element to sort by.     |
| **Order By**           | Whether to sort in ascending or descending order. |
| **Add Order By XPath** | Click this button to add more XPaths to sort by.  |

### Settings Tab

#### Configuration

*Settings related to establishing the connection.*

<NameDescription />

### Automation Tab

#### Automation Settings

*Settings related to the automatic processing of files by the connector.*

| Setting  | Description                                                                     |
| -------- | ------------------------------------------------------------------------------- |
| **Send** | Check this to have the connector automatically send groups when they are ready. |

#### Performance

<Performance />

### Alerts Tab

<AlertsTab />

### SLAs Tab

<SlasTab />

### Advanced Tab

#### Logging

<Logging />

#### Other Settings

| Setting              | Description                                                                                                                                                                                                                                                                              |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Processing Delay** | The amount of time (in seconds) by which the processing of files placed in the **Transactions** tab is delayed. This is a legacy setting. Best practice is to [use a File connector](../flows/designing-a-flow#ローカルファイルシステムとのやり取り) to manage local file systems instead of this setting. |

#### Miscellaneous

<MiscConnector />

## Using Sample Files

Toggle **Sample File** on to upload a sample input XML that mimics the XML input that is going to be passed into the connector.

When enabled, it provides XPath helpers for each of the XPath fields in the UI, so it becomes easier to see the document structure and select the correct XPath. You can only click eligible XML elements, based on what the XPath is representing for the connector.

For example, in **Loop Settings**, you can only select parent elements because {siteNameShort} expects that those elements are what represent a *record*.

<img src="https://mintcdn.com/cdata-arc/97fbscTC2p-cCdS3/public/images/xml-group-loop-settings.png?fit=max&auto=format&n=97fbscTC2p-cCdS3&q=85&s=898925a14518c1ee02fa29301cff6947" width="600" data-path="public/images/xml-group-loop-settings.png" />

Then, in **Group Settings**, the visible elements are the child elements of the **Loop Settings** parent element because {siteNameShort} expects the *key* element to be a child of the parent record.

<img src="https://mintcdn.com/cdata-arc/97fbscTC2p-cCdS3/public/images/xml-group-group-settings.png?fit=max&auto=format&n=97fbscTC2p-cCdS3&q=85&s=9bab36c4756af43033f3c22476e5c8b2" width="600" data-path="public/images/xml-group-group-settings.png" />

## Using Group Settings

Group settings define the elements in each record to use to determine the key for each group. The key is usually an `Id` value such as `CustomerID` or `InvoiceID`. You can have multiple keys, which appear as children of the element name and xpath set in [Loop Settings](#loop-settings).

* **Element Name** tells the connector what to name the XML element to use for grouping in the output file. This is usually the same name as the element in the input file that the Key XPath points to, but you can use a different name.
* **Key XPath** is the XPath from the input file of the element to use as the *key* (what you want to group by). The **Key XPath** is relative to the **Record XPath**.

For example, in the following XML, the `<MaterialCode>` element is the key. This lets you group all occurrences of `ALPHA`, `BRAVO` and `CHARLIE` together in the output, instead of having multiples of each.

```xml theme={null}
<Items>
    <Invoice>
        <InvoiceDetail>
            <MaterialCode>ALPHA</MaterialCode>
            <MaterialCodeDescription>Alpha Materials</MaterialCodeDescription>
            <NetAmount>1000.00</NetAmount>
        </InvoiceDetail>
        <InvoiceDetail>
            <MaterialCode>ALPHA</MaterialCode>
            <MaterialCodeDescription>Alpha Materials</MaterialCodeDescription>
            <NetAmount>2000.00</NetAmount>
        </InvoiceDetail>
        <InvoiceDetail>
            <MaterialCode>BRAVO</MaterialCode>
            <MaterialCodeDescription>Bravo Materials</MaterialCodeDescription>
            <NetAmount>100.00</NetAmount>
        </InvoiceDetail>
        <InvoiceDetail>
            <MaterialCode>CHARLIE</MaterialCode>
            <MaterialCodeDescription>Charlie Materials</MaterialCodeDescription>
            <NetAmount>500.00</NetAmount>
        </InvoiceDetail>
        <InvoiceDetail>
            <MaterialCode>CHARLIE</MaterialCode>
            <MaterialCodeDescription>Charlie Materials</MaterialCodeDescription>
            <NetAmount>100.00</NetAmount>
        </InvoiceDetail>
    </Invoice>
</Items>
```

## Using Summary Settings

Summary settings control how the connector should aggregate data. You can define an XPath containing a value that you want to perform an action operator on (MIN, MAX, SUM, AVG, COUNT, CONCATENATE), and the connector then performs that operator on all records in a group. A common example is to SUM the price of each record.

The following example uses the **Loop Settings** and **Group Settings** described in the previous images, along with the following **Summary Settings**:

<img src="https://mintcdn.com/cdata-arc/97fbscTC2p-cCdS3/public/images/xml-group-group-settings.png?fit=max&auto=format&n=97fbscTC2p-cCdS3&q=85&s=9bab36c4756af43033f3c22476e5c8b2" width="600" data-path="public/images/xml-group-group-settings.png" />

Using the XML in the previous section results in an output XML with a `InvoiceDetailGroup` for each key element (the `MaterialCode`). Inside each `InvoiceDetailGroup` is the `MaterialCode` key from the **Group Settings**, and the calculated `NetAmountSUM` from the **Summary Settings**. Finally, the original `InvoiceDetail` elements and their children are included:

```xml theme={null}
<Items>
  <Invoice>
    <InvoiceDetailGroup>
      <MaterialCode>ALPHA</MaterialCode>
      <NetAmountSUM>3000</NetAmountSUM>
      <InvoiceDetail>
        <MaterialCode>ALPHA</MaterialCode>
        <MaterialCodeDescription>Alpha Materials</MaterialCodeDescription>
        <NetAmount>1000.00</NetAmount>
      </InvoiceDetail>
      <InvoiceDetail>
        <MaterialCode>ALPHA</MaterialCode>
        <MaterialCodeDescription>Alpha Materials</MaterialCodeDescription>
        <NetAmount>2000.00</NetAmount>
      </InvoiceDetail>
    </InvoiceDetailGroup>
    <InvoiceDetailGroup>
      <MaterialCode>BRAVO</MaterialCode>
      <NetAmountSUM>100.00</NetAmountSUM>
      <InvoiceDetail>
        <MaterialCode>BRAVO</MaterialCode>
        <MaterialCodeDescription>Bravo Materials</MaterialCodeDescription>
        <NetAmount>100.00</NetAmount>
      </InvoiceDetail>
    </InvoiceDetailGroup>
    <InvoiceDetailGroup>
      <MaterialCode>CHARLIE</MaterialCode>
      <NetAmountSUM>600</NetAmountSUM>
      <InvoiceDetail>
        <MaterialCode>CHARLIE</MaterialCode>
        <MaterialCodeDescription>Charlie Materials</MaterialCodeDescription>
        <NetAmount>500.00</NetAmount>
      </InvoiceDetail>
      <InvoiceDetail>
        <MaterialCode>CHARLIE</MaterialCode>
        <MaterialCodeDescription>Charlie Materials</MaterialCodeDescription>
        <NetAmount>100.00</NetAmount>
      </InvoiceDetail>
    </InvoiceDetailGroup>
  </Invoice>
</Items>
```

Because you already have the associated records as nested children of the key, instead of in a flat structure, this XML is easier to work with when it goes to an [XML Map](./xml-map/xml-map) connector.

## Macros

<MacrosTable />

### Examples

<MacrosExamples />
