Skip to content

Commit

Permalink
Updated Simulation Result mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
  • Loading branch information
tonydamage committed Dec 6, 2022
1 parent 817536a commit 5c3b5c5
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 1 deletion.
1 change: 1 addition & 0 deletions infra/schema-pure-jaxb/src/compile/resources/catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Used when building via xjc.
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-gui-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-gui-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-provisioning-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-provisioning-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-correlation-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-correlation-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-simulations-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-simulations-3.xsd" />

<!-- WSDLs -->
<public publicId="http://midpoint.evolveum.com/xml/ns/public/model/model-3" uri="../../../target/midpoint-schema/xml/ns/public/model/model-3.wsdl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10645,6 +10645,19 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="simulation" type="tns:SystemConfigurationSimulationType">
<xsd:annotation>
<xsd:documentation>
Global settings related to simulation
</xsd:documentation>
<xsd:appinfo>
<a:displayName>SystemConfigurationType.simulation</a:displayName>
<a:since>4.7</a:since>
<a:experimental>true</a:experimental>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>

</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
elementFormDefault="qualified"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
Expand All @@ -28,6 +29,7 @@
<!-- Don't provide schemaLocation here, as it causes xjc to really contact the URIs (!) -->
<xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3"/>
<xsd:import namespace="http://prism.evolveum.com/xml/ns/public/types-3"/>
<xsd:import namespace="http://prism.evolveum.com/xml/ns/public/query-3"/>

<xsd:include schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-core-3"/>

Expand Down Expand Up @@ -56,6 +58,30 @@

<xsd:element name="simulationResult" type="tns:SimulationResultType" substitutionGroup="c:object"/>


<xsd:complexType name="SystemConfigurationSimulationType">
<xsd:annotation>
<xsd:documentation>
Global Configuration of Simulations.
</xsd:documentation>
<xsd:appinfo>
<a:container/>
<a:since>4.7</a:since>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="useOwnPartitionForProcessedObjects" type="xsd:boolean" />
<!-- TODO: Do we want storage strategies per type? or per metric?
Storage strategies may be beneficial for large deployments
- eg. do not store information about objects, that do not match any metric
or are unmodified.
- do not store before / after state
-->
<xsd:element name="metrics" type="tns:SimulationMetricDefinitionType" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="SimulationMetricDefinitionType">
<xsd:annotation>
<xsd:documentation>
Expand All @@ -67,11 +93,31 @@
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="identifier" type="xsd:string "/>
<xsd:element name="identifier" type="xsd:string"/>
<xsd:element name="displayName" type="t:PolyStringType"/>
<xsd:element name="filter" type="tns:SimulationMetricBeforeAfterFilter" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="SimulationMetricBeforeAfterFilter">
<xsd:annotation>
<xsd:documentation>
Pair of filters, which are run on object before / after state.

In order for object to match this filter, it must match both filters
if they are present.
</xsd:documentation>
<xsd:appinfo>
<a:container/>
<a:since>4.7</a:since>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="beforeFilter" type="q:SearchFilterType" />
<xsd:element name="afterFilter" type="q:SearchFilterType" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="SimulationMetricType">
<xsd:annotation>
<xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

public class MSimulationResult extends MObject {

public Boolean partitioned;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
*/
package com.evolveum.midpoint.repo.sqale.qmodel.simulation;

import java.sql.Types;

import com.evolveum.midpoint.repo.sqale.qmodel.object.QObject;
import com.querydsl.core.types.dsl.BooleanPath;
import com.querydsl.sql.ColumnMetadata;

public class QSimulationResult extends QObject<MSimulationResult> {

public static final String TABLE_NAME = "m_simulation_result";

public static final ColumnMetadata PARTITIONED =
ColumnMetadata.named("partitioned").ofType(Types.BOOLEAN);

public QSimulationResult(String variable) {
this(variable, DEFAULT_SCHEMA_NAME, TABLE_NAME);
}
Expand All @@ -20,4 +27,6 @@ public QSimulationResult(String variable, String schema, String table) {
super(MSimulationResult.class, variable, schema, table);
}

public final BooleanPath partitioned = createBoolean("partitioned", PARTITIONED);

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private QSimulationResultMapping(@NotNull SqaleRepoContext repositoryContext) {
addContainerTableMapping(F_PROCESSED_OBJECT,
QProcessedObjectMapping.initProcessedResultMapping(repositoryContext),
joinOn((o, processed) -> o.oid.eq(processed.ownerOid)));
addItemMapping(F_USE_OWN_PARTITION_FOR_PROCESSED_OBJECTS, booleanMapper(q -> q.partitioned));
}

@Override
Expand Down

0 comments on commit 5c3b5c5

Please sign in to comment.