現在の状態と目的の状態に基づいてアクションを計算するには、 mip::ExecutionState クラスを実装して MIP SDK に情報を渡します。 SDK の他のクラスと同様に、 ExecutionState は抽象クラスであり、開発者はそれを実装する必要があります。
Note
ExecutionState実装の完全な例については、次のサンプル ソースを参照してください。
mip::ExecutionState のメンバー
ExecutionState は、次の仮想メンバーを公開します。 各メンバーは、アプリケーションが実行する必要があるアクションに関する情報を返すことができるように、ポリシー エンジンにコンテキストを提供します。 SDK では、この情報を使用して、Microsoft Purview に監査情報を提供することもできます。
| メンバー | 返品ポリシー |
|---|---|
std::shared_ptr<mip::Label> GetNewLabel() |
SDK がオブジェクトに適用するラベルを返します。 |
mip::DataState GetDataState() |
オブジェクトの mip::D ataState を返します。 |
std::pair<bool, std::string> IsDowngradeJustified() |
ダウングレードが正当化されているかどうかとその正当化を表す std::pair を返します。 |
std::string GetContentIdentifier() |
コンテンツ識別子を返します。 オブジェクトの場所を示す人間が判読できる識別子を使用します。 |
std::string GetApplicationScenarioId() |
アプリケーション イベントを対応する監査または保護サービス REST 要求に関連付ける識別子を返します。 |
mip::AssignmentMethod GetNewLabelAssignmentMethod() |
ラベルの mip::AssignmentMethod を返します。 |
std::vector<std::pair<std::string, std::string>> GetNewLabelExtendedProperties() |
SDK がドキュメントに適用するカスタムメタデータを含む、文字列の std::pairs から成る std::vector を返します。 |
std::vector<mip::MetadataEntry> GetContentMetadata() |
現在のコンテンツ メタデータを含む mip::MetadataEntry オブジェクトの std::vector を返します。 |
std::shared_ptr<mip::ProtectionDescriptor> GetProtectionDescriptor() |
mip::ProtectionDescriptor へのポインターを返します。 |
std::string GetContentFormat() |
文字列を返します。 |
mip::ActionType GetSupportedActions() |
ラベルの mip::ActionTypes を返します。 |
std::shared_ptr<mip::ClassificationResults> GetClassificationResults() |
実装されている場合は、分類結果の一覧を返します。 |
mip::ExecutionStateから派生したクラスの実装で各メンバーをオーバーライドします。 前のサンプル アプリケーションでは、サンプルは ExecutionStateOptions という構造体を実装し、その構造体を派生クラスのコンストラクターに渡します。
この 例では 、 ExecutionStateOptionsという構造体を定義します。
struct ExecutionStateOptions {
std::unordered_map<std::string, std::string> metadata;
std::string newLabelId;
std::string contentIdentifier;
mip::ActionSource actionSource = mip::ActionSource::MANUAL;
mip::DataState dataState = mip::DataState::USE;
mip::AssignmentMethod assignmentMethod = mip::AssignmentMethod::STANDARD;
bool isDowngradeJustified = false;
std::string downgradeJustification;
std::string templateId;
std::string contentFormat = mip::GetFileContentFormat();
mip::ActionType supportedActions;
bool generateAuditEvent;
};
アプリケーションの各プロパティを設定し、mip::ExecutionStateから派生したクラスのコンストラクターにExecutionStateOptionsを渡します。 SDK はこの情報を使用して、実行するアクションを決定します。 Microsoft Purview監査レポートには、mip::ExecutionStateで提供されるデータも表示されます。
次のステップ
- 現在の状態と目的の状態に基づいて、 新規または既存のラベルのコンピューティング アクションを決定する方法について説明します。
- GitHubから Policy SDK のサンプルをダウンロードし、Policy SDK を試します。