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

# GetTaskExt

> ABBYY FlexiCapture Web Services API の GetTaskExt メソッドは、ステージタイプに基づいて最も優先度の高いタスクを選択し、処理のために開きます。

<div id="what-it-does">
  ## 動作内容
</div>

最も優先度の高いタスクを選択し、処理できるように開きます。選択したタスクはロックされるため、他のユーザーは開けません。利用可能なバッチを絞り込むこともできます。

<Info>
  タスクに対して操作を実行するには、事前にそのタスクを開いておく必要があります。
</Info>

<div id="definition">
  ## 定義
</div>

```csharp theme={null}
int GetTaskExt(int sessionId, int projectId, int stageType, bool onlyPreprocessedTask, bool onlyPrivateBatches);
```

<div id="parameters">
  ## パラメーター
</div>

| 名前                     | 型      | 説明                                                                                                                |
| ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `sessionId`            | `int`  | Application Server への接続の ID。                                                                                      |
| `projectId`            | `int`  | Project ID。                                                                                                       |
| `stageType`            | `int`  | ステージタイプの ID。指定可能な値については、[ProcessingStageType](/ja/flexi-capture/api/structures/t-processing-stage-type)を参照してください。 |
| `onlyPreprocessedTask` | `bool` | 選択対象のタスクを決定するフラグ。`True`の場合は前処理済みのタスクのみを、`False`の場合はすべてのタスクから選択します。                                                |
| `onlyPrivateBatches`   | `bool` | 利用可能なバッチの範囲を決定するフラグ。`True`の場合は現在のユーザーまたはユーザー グループに属するバッチのみを利用可能にし、`False`の場合はすべてのバッチを利用可能にします。                    |

<div id="returned-value">
  ## 戻り値
</div>

| 型     | 説明     |
| ----- | ------ |
| `int` | タスクID。 |
