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

# arc:info

> 使用 arc:info 描述指令碼中繼資料，包括列定義、輸入參數以及指令碼生成的輸出。

export const siteNameShort = "知行之橋";

`arc:info` 關鍵字用來為指令碼描述中繼資料。這些資訊被應用程式用來實現對使用者輸入基本的錯誤檢查和設定預設值。`arc:info` 關鍵字可包含以下內容：

* 列定義
* 指令碼期望的輸入參數
* 指令碼產生的輸出

## 指令碼參數

以下的參數可以為指令碼本身定義：

* **desc\[ription]**：指令碼的描述。如果未提供描述，則使用指令碼的名稱。
* **title**：指令碼的標題。如果未提供標題，則使用指令碼的名稱。
* **methods**：可以對指令碼執行的 HTTP 方法。SELECT，INSERT，UPDATE 和 DELETE 分別對應 HTTP GET，POST，PUT／PATCH／MERGE 和 DELETE。
* **url**：指令碼作者的 URL。
* **keywords**：描述指令碼的關鍵詞。

## 輸入，輸出和列參數

`arc:info` 關鍵字在其範圍中還有其它的參數，定義了列以及指令碼輸入和輸出。
<Note>這些參數不是 ArcScript 關鍵字，而是 `arc:info` 的其它資訊。</Note>

### 輸入

輸入參數可以用作描述指令碼的輸入。

```xml theme={null}
<input
  name="name"
  desc="Example of an input parameter"
  default="defValue"
  req="true"
  values="value1, value2, value3"
  xs:type="string" 
/>
```

* **name**：輸入的名稱。一個含字母數字的字串，還可以包含以下內容：
  * `#` 表示輸入可以有多個值
  * `myprefix:\*` 表示一組具有相同字首的輸入
  * `\*` 表示任意的輸入參數。
* **desc\[ription]**：對輸入的簡短描述。
* **xs:type**：輸入的資料型別。支援 `string`，`int`，`double`，`datetime` 和 `boolean` 型別。
* **def\[ault]**：當輸入值未在指令碼呼叫中提供時，使用的預設值。
* **key**：輸入是否是主索引鍵。
* **req\[uired]**：輸入值是否是必需的。如果必需的輸入未提供且沒有預設值時，將會擲回錯誤。允許值為 `true` 和 `false`。
* **values**：輸入允許值的清單，以逗號分隔。如果指定，當特定的 input 未能與允許值匹配到時，將會擲回錯誤。
* **alias**：輸入的別名。
* **other**：字首為 `other:` 的屬性，可提供更多資訊。這些其它屬性可以是特定於運算器的。

### 輸出

輸出參數用來描述運算器的輸出。然而，應用程式會忽略掉它們。因此，運算器的輸出可以完全獨立於在 info 塊中定義的內容。

```xml theme={null}
<output  name="Id" 
         desc="The unique identifier of the record."
         xs:type="string"
         other:xPath="content/properties/Id" 
/>
```

* **name**：輸出的名稱。“myprefix:\*” 表示一組具有相同字首的輸出，“\*”表示任意的輸出參數。
* **xs:type**：輸出的資料型別。支援 string，int，double，datetime 和 boolean 型別。
* **desc\[ription]**：對輸出的簡短描述。
* **columnsize**: 字串的最大字元長度或數字輸出的精度。精度是數字的位數。
* **other**：字首為 “other:” 的屬性，可提供更多資訊。例如，other:xPath 指定了在本地或遠端資源中節點的 XPath。該 XPath 可以是相對於 RepeatElement 的。

## 範例

描述接收後事件的輸入：

```xml theme={null}
<arc:info title="After Receive"  desc="This event is fired after receiving a file.">
  <input name="Filename"         desc="The name of the file that was sent." />
  <input name="FilePath"         desc="The path of the file that was received." />
  <input name="MessageId"        desc="The Id of the transmission." />
  <input name="ErrorMessage"     desc="If an error occurred, this will contain the error message." />
</arc:info>
```

## 另請參閱

* [arc:script](./op-arc-script)：建立一個指令碼程式碼塊。
* [arc:call](./op-arc-call)：呼叫指令碼或運算器。
* [arc:set](./op-arc-set)：在物件中設定屬性。
