Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private insertDefinitionPartition(rulesetSubject: Subject): DefinitionPartition {
const partitionCode = DefinitionPartition.createCode(this._iModelDb, rulesetSubject.id, this._rulesetModelName);
const definitionPartitionProps: InformationPartitionElementProps = {
parent: {
id: rulesetSubject.id,
relClassName: "BisCore:SubjectOwnsPartitionElements",
},
model: rulesetSubject.model,
code: partitionCode,
classFullName: DefinitionPartition.classFullName,
};
const id = this._iModelDb.elements.insertElement(definitionPartitionProps);
return this._iModelDb.elements.getElement(id) as DefinitionPartition;
}
private queryDefinitionPartition(): DefinitionPartition | undefined {
const subject = this.querySubject();
if (undefined === subject)
return undefined;
return this._iModelDb.elements.getElement(DefinitionPartition.createCode(this._iModelDb, subject.id, this._rulesetModelName));
}