Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To compute an action based on the current state and desired state, pass information into the MIP SDK by implementing the mip::ExecutionState class. Like other classes in the SDK, ExecutionState is an abstract class, and the developer must implement it.
Note
For a complete example of an ExecutionState implementation, see the following sample source:
mip::ExecutionState members
ExecutionState exposes the following virtual members. Each member provides context to the policy engine so it can return information about which actions the application should take. The SDK can also use this information to provide audit information to Microsoft Purview.
| Member | Returns |
|---|---|
std::shared_ptr<mip::Label> GetNewLabel() |
Returns the label that the SDK applies to the object. |
mip::DataState GetDataState() |
Returns the mip::DataState of the object. |
std::pair<bool, std::string> IsDowngradeJustified() |
Returns a std::pair expressing whether downgrade is justified and the justification. |
std::string GetContentIdentifier() |
Returns the content identifier. Use a human-readable identifier that indicates the location of the object. |
std::string GetApplicationScenarioId() |
Returns an identifier that correlates application events with the corresponding audit or protection service REST requests. |
mip::AssignmentMethod GetNewLabelAssignmentMethod() |
Returns the mip::AssignmentMethod of the label. |
std::vector<std::pair<std::string, std::string>> GetNewLabelExtendedProperties() |
Returns a std::vector of std::pairs of strings that contain the custom metadata that the SDK applies to the document. |
std::vector<mip::MetadataEntry> GetContentMetadata() |
Returns a std::vector of mip::MetadataEntry objects that contain the current content metadata. |
std::shared_ptr<mip::ProtectionDescriptor> GetProtectionDescriptor() |
Returns a pointer to a mip::ProtectionDescriptor. |
std::string GetContentFormat() |
Returns a string. |
mip::ActionType GetSupportedActions() |
Returns mip::ActionTypes for the label. |
std::shared_ptr<mip::ClassificationResults> GetClassificationResults() |
Returns a list of classification results, if implemented. |
Override each member in an implementation of a class derived from mip::ExecutionState. In the preceding sample application, the sample implements a struct called ExecutionStateOptions and passes that struct to the constructor of the derived class.
The example defines a struct called 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;
};
Set each property in the application, and then pass ExecutionStateOptions to the constructor of the class derived from mip::ExecutionState. The SDK uses this information to determine the actions to take. Microsoft Purview audit reports also show data provided in mip::ExecutionState.
Next steps
- Learn how to determine compute actions for a new or existing label, based on the current and desired state.
- Download the Policy SDK samples from GitHub and try out the Policy SDK.