<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
  ~ Copyright (C) 2015-2021 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/common/audit-3" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" elementFormDefault="qualified" jaxb:extensionBindingPrefixes="xjc" jaxb:version="3.0" targetNamespace="http://midpoint.evolveum.com/xml/ns/public/common/audit-3">

    <xsd:annotation>
        <xsd:documentation>
            Schema for audit event serialization.

            Recommended namespace prefix: audit
        </xsd:documentation>
        <xsd:appinfo>
            <a:defaultPrefix>audit</a:defaultPrefix>
        </xsd:appinfo>
    </xsd:annotation>

    <xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/common/common-3" schemaLocation="common-3.xsd">
        <xsd:annotation>
            <xsd:documentation>
                Common midPoint schema.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:import>

    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3" schemaLocation="../annotation-3.xsd">
        <xsd:annotation>
            <xsd:documentation>
                Common midPoint annotations used in various XSD schemas.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:import>

    <xsd:import namespace="http://prism.evolveum.com/xml/ns/public/types-3" schemaLocation="../types-3.xsd">
        <xsd:annotation>
            <xsd:documentation>
                Prism data types.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:import>

    <xsd:complexType name="AuditEventRecordListType">
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="object" type="tns:AuditEventRecordType"/>
        </xsd:sequence>
        <xsd:attribute name="count" type="xsd:int"/>
    </xsd:complexType>

    <xsd:complexType name="AuditEventRecordType">
        <xsd:annotation>
            <xsd:documentation>
                Audit event record describes a single event (usually data change) in a format suitable for audit.
            </xsd:documentation>
            <xsd:appinfo>
                <a:container/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="1" name="timestamp" type="xsd:dateTime">
                <xsd:annotation>
                    <xsd:documentation>
                        Timestamp when the event occurred.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.timestamp</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="eventIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Unique identification of the event.
                        Every record should have unique event identifier.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.eventIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="sessionIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Identification of (interactive) session in which the event occurred.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.sessionIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="requestIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Identifier of a request (operation). All the records that are result of
                            processing of a single request should have the same identifier.
                            In usual case there should be be a single request-stage record
                            and one or more execution-stage records with the same request
                            identifier.
                        </p>
                        <p>
                            Please note that this is quite different than task identifier.
                            A single task can make many requests. E.g. a typical reconciliation
                            task will make thousands of operations. All of the audit records from
                            all of those operations will have the same task identifier. But each
                            operation will have a separate request identifier.
                        </p>
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.requestIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="taskIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Task identifier. Operations are executed in a context of a task.
                            This field is an identifier of the task. It is not (necessarily) an
                            OID of the task, as an operation may be executed in an non-persistent
                            (lightweight) task. This field should be populated for all audit records,
                            perhaps except very special system-level records that are executed outside
                            of a task.
                        </p>
                        <p>
                            Please note that this is quite different than request identifier.
                            A single task can make many requests. E.g. a typical reconciliation
                            task will make thousands of operations. All of the audit records from
                            all of those operations will have the same task identifier. But each
                            operation will have a separate request identifier.
                        </p>
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.taskIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="taskOID" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Task OID. This field is used for records that are executed in the context
                        of a persistent task.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.taskOID</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="hostIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Identifier of a host that generated the audit record.
                        This is the host name corresponding to a network interface that accepted the HTTP request.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.hostIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="nodeIdentifier" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Identifier of a node in a midPoint cluster that generated the audit record.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.nodeIdentifier</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="remoteHostAddress" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Network address of a remote host that originated the request causing this event.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.remoteHostAddress</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="initiatorRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Initiator is the (legal) entity on behalf of whom is the action executed.
                        It is the subject of the operation. Authorizations of the initiator are
                        used to evaluate access to the operation. This is the entity who is formally
                        responsible for the operation. Although initiator is always a user in
                        midPoint 3.7 and earlier, the initiator may be an organization, a role,
                        or a service in later midPoint versions.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:objectReferenceTargetType>c:FocusType</a:objectReferenceTargetType>
                        <a:displayName>AuditEventRecordType.initiatorRef</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="attorneyRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Attorney is the (physical) user who have executed the action.
                        This is the user that have logged-in to the user interface. This is the
                        user that pressed the button to execute the action.

                        For the vast majority of cases, this is really an object of UserType. But sometimes it can be
                        a ServiceType (or, very occasionally, maybe RoleType or OrgType - but this does not make
                        much sense).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:objectReferenceTargetType>c:FocusType</a:objectReferenceTargetType>
                        <a:displayName>AuditEventRecordType.attorneyRef</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="effectivePrincipalRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        The effective principal that was used to execute the action.
                        This is the subject whose authorizations were evaluated to determine whether the action is allowed or not.
                        Usually it is the same as initiator. But e.g. when "runAsRef" mechanism is used for expression evaluation
                        (or the like), the effective principal is the one that was used to evaluate the expression.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.8</a:since>
                        <a:objectReferenceTargetType>c:FocusType</a:objectReferenceTargetType>
                        <a:displayName>AuditEventRecordType.effectivePrincipalRef</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="effectivePrivilegesModification" type="tns:EffectivePrivilegesModificationType">
                <xsd:annotation>
                    <xsd:documentation>
                        Present if the effective privileges used to execute the operation differ or may differ from the regular
                         (declared) privileges of the "effectivePrincipalRef". This is usually the case e.g. when
                        "runPrivileged" mechanism is used for expression evaluation.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.8</a:since>
                        <a:objectReferenceTargetType>c:FocusType</a:objectReferenceTargetType>
                        <a:displayName>AuditEventRecordType.effectivePrivilegesModification</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="targetRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Object that is a primary target of an operation (if applicable).
                        In case that operation targets more than one object, the "primary" or
                        the most important is recorded (e.g. the user object)
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.targetRef</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="targetOwnerRef" type="c:ObjectReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Owner of the object that is a target of this operation (if applicable).
                        E.g. a owner of a task that is being stopped, owner of an account that
                        is being modified, etc.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:objectReferenceTargetType>c:UserType</a:objectReferenceTargetType>
                        <a:displayName>AuditEventRecordType.targetOwnerRef</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="eventType" type="tns:AuditEventTypeType">
                <xsd:annotation>
                    <xsd:documentation>
                        Type of audit event. It describes what kind of operation was executed
                        (adding an object, modification, user login, ...)
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.eventType</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="eventStage" type="tns:AuditEventStageType">
                <xsd:annotation>
                    <xsd:documentation>
                        Stage of event processing: request or execution.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.eventStage</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="delta" type="c:ObjectDeltaOperationType">
                <xsd:annotation>
                    <xsd:documentation>
                        Delta or objects affected by this audit operation.
                        NOTE: In future this could be renamed to affectedObjects or similar to better
                        signify that delta may be empty, but object was affected in some way by audit operation.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.delta</a:displayName>
                        <!-- delta is property in complex value, so explicit mark as searchable is required by filter parser
                             to allow parsing matches filter and treat it similar to container -->
                        <a:searchable>true</a:searchable>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="channel" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        The channel that was the source of the operation that the record describes
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.channel</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="outcome" type="c:OperationResultStatusType">
                <xsd:annotation>
                    <xsd:documentation>
                        Operation outcome (success, failure)
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.outcome</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="result" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        result (e.g. number of entries, returned object, business result of workflow task or process instance - approved, rejected)
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.result</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="parameter" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Parameter string, the usage depends on the event type.
                        E.g. username for session start/stop, etc.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.parameter</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="message" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Optional human readable message, if necessary, e.g. an error message.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:displayName>AuditEventRecordType.message</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="changedItem" type="t:ItemPathType">
                <xsd:annotation>
                    <xsd:documentation>
                        Represents searchable list of changed item paths related to this audit record.
                        As of 4.2 this item is only enables usage in Query API against
                        the repository (DB) and is not to be used otherwise.
                        This does NOT have to be all the paths touched by audit record related deltas;
                        e.g. the list of path types stored here may be configurable.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.2</a:since>
                        <a:displayName>AuditEventRecordType.changedItem</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="property" type="tns:AuditEventRecordPropertyType">
                <xsd:annotation>
                    <xsd:documentation>
                        Represents additional information for which specific property is not available.
                        Conceptually, all the values together represent a multi-map (string -&gt; set of strings).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.6</a:since>
                        <a:displayName>AuditEventRecordType.property</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="reference" type="tns:AuditEventRecordReferenceType">
                <xsd:annotation>
                    <xsd:documentation>
                        Represents additional reference information for which specific property is not available.
                        Conceptually, all the values together represent a multi-map (string -&gt; set of refs).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>3.6</a:since>
                        <a:displayName>AuditEventRecordType.reference</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="resourceOid" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Resource OIDs. This field is used for resource OIDs of target, when target is FocusType or Shadowtype.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                        <a:displayName>AuditEventRecordType.resourceOid</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="customColumnProperty" type="tns:AuditEventRecordCustomColumnPropertyType">
                <xsd:annotation>
                    <xsd:documentation>
                        Field of custom column for audit resord table.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.0</a:since>
                        <a:experimental>true</a:experimental>
                        <a:displayName>AuditEventRecordType.customColumnProperty</a:displayName>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="repoId" type="xsd:long">
                <xsd:annotation>
                    <xsd:documentation>
                        HIGHLY EXPERIMENTAL!

                        Repository ID. This is the ID generated by and stored in DB.

                        For internal use only. Do not use in custom implementations. Do not rely on it.
                        It might change in the future or be removed at all. In the future, might be replaced with container.id.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <a:since>4.3.1</a:since>
                        <a:displayName>AuditEventRecordType.repoId</a:displayName>
                        <a:experimental>true</a:experimental>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="auditEventRecord" type="tns:AuditEventRecordType"/>

    <xsd:complexType name="AuditEventRecordItemType">
        <xsd:annotation>
            <xsd:documentation>
                Common supertype for multi-value key-value properties in the audit record.
                This conceptually represents a single entry in a map and its key (name).
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="1" name="name" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="AuditEventRecordCustomColumnPropertyType">
        <xsd:annotation>
            <xsd:documentation>
                One custom column property entry for audit record.
                These are stored in custom columns in the audit record table.
                <!-- TODO: This should be replaced by extension container. -->
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.0</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:AuditEventRecordItemType">
                <xsd:sequence>
                    <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:string"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="AuditEventRecordPropertyType">
        <xsd:annotation>
            <xsd:documentation>
                One property entry for audit records.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:AuditEventRecordItemType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="value" type="xsd:string"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="AuditEventRecordReferenceType">
        <xsd:annotation>
            <xsd:documentation>
                Type representing named set of references for an audit record.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="tns:AuditEventRecordItemType">
                <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" minOccurs="0" name="value" type="tns:AuditEventRecordReferenceValueType"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="AuditEventRecordReferenceValueType">
        <xsd:annotation>
            <xsd:documentation>
                Type representing a single additional references for an audit record.
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>3.6</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="0" name="oid" type="xsd:string"/>
            <xsd:element minOccurs="0" name="type" type="xsd:QName"/>
            <xsd:element minOccurs="0" name="targetName" type="t:PolyStringType"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="AuditEventTypeType">
        <xsd:annotation>
            <xsd:documentation>
                Type of audit event, see the usage for more information.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="getObject">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="GET_OBJECT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="addObject">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ADD_OBJECT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="modifyObject">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="MODIFY_OBJECT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="deleteObject">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="DELETE_OBJECT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="executeChangesRaw">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EXECUTE_CHANGES_RAW"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="synchronization">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SYNCHRONIZATION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="createSession">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="CREATE_SESSION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="terminateSession">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="TERMINATE_SESSION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workItem">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORK_ITEM"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="workflowProcessInstance">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="WORKFLOW_PROCESS_INSTANCE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="reconciliation">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RECONCILIATION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="suspendTask">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SUSPEND_TASK"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="resumeTask">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RESUME_TASK"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="runTaskImmediately">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RUN_TASK_IMMEDIATELY"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="discoverObject">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="DISCOVER_OBJECT"/>
                        <a:since>4.8</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="informationDisclosure">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="INFORMATION_DISCLOSURE"/>
                        <a:since>4.8</a:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="AuditEventStageType">
        <xsd:annotation>
            <xsd:documentation>
                Stage of event processing: request or execution.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="request">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="REQUEST"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="execution">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EXECUTION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="resource">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RESOURCE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="EffectivePrivilegesModificationType">
        <xsd:annotation>
            <xsd:documentation>
                How were the effective privileges modified?
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
                <a:since>4.8</a:since>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="elevation">
                <xsd:annotation>
                    <xsd:documentation>
                        Privileges were elevated to some degree. It may or may not be the maximum degree (full authorization).
                        Only if we are really sure, we set "fullElevation" value.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="ELEVATION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="fullElevation">
                <xsd:annotation>
                    <xsd:documentation>
                        Privileges were elevated to the maximum degree, i.e. to full authorization.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="FULL_ELEVATION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="reduction">
                <xsd:annotation>
                    <xsd:documentation>
                        Privileges were reduced to some degree.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="REDUCTION"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="other">
                <xsd:annotation>
                    <xsd:documentation>
                        Privileges were changed in a different way (maybe some reduced, others elevated).
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="OTHER"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:schema>