Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Statusstatus
Page Properties
hiddentrue
id
DONE

colourYellow
titleprogress
Priority
Product Version
Report Note
AssigneeAntje

Resources & Remarks

Remarks
  • Antje: page created as a copy of the schema tutorial
  • Inga - Review
    • Überschriften für Tutorials sind aktiv formuliert - was mache ich ... Using property definitions several times | Overwriting property attribute "required"
    • Einsortieren würde ich erst einmal vor dem Tagging in der Navigation 
    • "property type" (e.g. integer / date / string)  vs. "property definition"
    • "object type" vs "object type definitions" - siehe z.B. im excerpt
    • defined properties are "referenced" in an object type definition vs. "selected"
    • Heading "Overwriting by a Secondary Object Type Definition" - An alternative possibility is the usage of a secondary object type on which the object type definition can be based. => verstehe den Satz nicht - was meint hier "based" - "enhanced" und nicht die OTdefinition, sondern die Instanz selbst ...
    • "non-static" vs. "floating" - wenn dies dann zur Laufzeit oder direkt beim Import hinzugefügt wird ... fehlt mir noch als Info in dem Absatz
    • Ich fände es gut, wie property definition mit in jedem Beispiel aufzuführen - damit der Initalwert sichtbarer ist - sind zwar 6 Zeilen aber wäre mir leichter gefallen zu lesen
    • Heading "Handling of Multiple Property References"
      • specifying ... es wird nur das Attribut genannt - wäre es nicht sinnvoll dies mit propertyreference zu erwähnen
      • CODE - zweiter SOT ist ohne attribute - ist das richtig so? / initial ist es ebenfalls auf false gesetzt - wird dann überschrieben?

Modification History

Use

Name
Excerpt
DateProduct VersionAction
Antje08 FEB 20212.4New page properties macro.



Excerpt

This tutorial shows how to reference the same property definition in different object types. In type definitions, in some of them , the property is required as a required property and in others it is not. This tutorial explains the possibilities by means of a document import exampleas a non-required property.


Section
bordertrue


Column

Table of Contents

Table of Contents
maxLevel3
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting Tutorial|Managing the Schema|Schema - Defining Object Types|DMS Endpoints)


Introduction

The metadata structure of object types has to be defined in the schema. In this definition, properties are selected referenced that should be connected to the object type. Each property itself is in turn defined in the schema as well by the specification of its attributes. The properties can be selected referenced or not selected referenced in object type definitions, but their attributes are fixed and can not cannot be modified. There The required attribute is the only one exception for the required attribute, that can actually exception as it can be overwritten by a propertyReference in object type definitions and secondary object type definitions. This provides the possibility makes it possible to decide for each property if individually whether it is required or not in each every single object type definition or not. Since schema structures can even be changed at runtime, yuuvis® Momentum offers a high flexibility in terms of document lifecycle management. In this tutorial, a simple document import will be considered as an example for the need of changing the requirement of properties.

Requirements

To work through this tutorial, the following is required:

Overwriting the

...

required

...

Attribute of

...

Properties

Any All property definition in definitions in the schema needs need the specification of the required attribute. Its boolean value decides if the corresponding property is mandatory (true) or optional (false) for an object.  However, the value of the required attribute can be overwritten by a propertyReference in object type definitions or secondary object type definitions.

Property Definition

In an import management system, documents might may be imported with less properties than they will have later lateron in their lifecycle. A fresh freshly imported object for example , does not necessarily have an editor. Later in the document lifecycle, this information might may be required. By overwriting the required attribute of the editor property editor, it is possible to use the same property throughout the whole entire lifecycle.

In the example code below, the editor property editor is defined. The required attribute of the editor property editor is set to true.  If not overwritten by a propertyReference, the property the editor will  property will be mandatory for any object of a type including containing the editor property in its definition.

Code Block
languageymlxml
titleProperty definition
linenumberstrue
<propertyStringDefinition>
    <id>editor</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>true</required>
</propertyStringDefinition>

Overwriting

...

Using a Document Type Definition

In an object a document type definition, a propertyReference can be used to set a value for the required attribute for of a property. This value can be different from the value specified in the property definition. In this case, the value of the required attribute will have the value from the object be specified in the document type definition.

Since for an imported1 document the editor property should be optional for an imported1 document, the required attribute is set to false by means of a propertyReference.

Code Block
languageymlxml
titleOverwriting of the required attribute by object document type definition
linenumberstrue
<propertyStringDefinition>
    <id>editor</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>true</required>
</propertyStringDefinition>

<typeDocumentDefinition>
    <id>imported1</id>
    <baseId>system:document</baseId>
    <propertyReference required="false">editor</propertyReference>
    <contentStreamAllowed>allowed</contentStreamAllowed>
</typeDocumentDefinition>

Overwriting

...

Using a Secondary Object Type

...

Definition

An alternative possibility is the usage of a option to reference a property in an object type definition is to include a floating secondary object type on which the object type definition can be based. Also in the definition of . In the secondary object type definition,  a a propertyReference can be used to set a value for the required attribute for a property. The required attribute value specified in the original property definition is again overwritten.

In the example code below, the editor property editor is not included directly in the imported2 document type definition. But it is based on the non-static (floating) secondary object type noeditor. The definition of noeditor uses the property editor property and sets its required attribute to false by means of a propertyReference. Thus, for objects documents of the type imported2, the property editor property will be available and optional.

Code Block
languageymlxml
titleOverwriting of the required attribute by secondary object type definition
linenumberstrue
<propertyStringDefinition>
    <id>editor</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>true</required>
</propertyStringDefinition>

<typeDocumentDefinition>
    <id>imported2</id>
    <baseId>system:document</baseId>
    <contentStreamAllowed>allowed</contentStreamAllowed>
    <secondaryObjectTypeId static="false">noeditor</secondaryObjectTypeId>
</typeDocumentDefinition>
 
<typeSecondaryDefinition>
    <id>noeditor</id>
    <baseId>system:secondary</baseId>
    <propertyReference required="false">editor</propertyReference>
</typeSecondaryDefinition>

Handling

...

Multiple Property References

In an object a document type definition, it is possible to set a value for the required attribute of a property, and additionally include multiple secondary object types specifying the required attribute for the same property as well. If at least in one definition among the others implies required=true, it this attribute will be true for every object document of the corresponding type. The value true dominates over false independently on regardless of the location of the propertyReference.

In the example code below, an object a document type imported3 is defined. The property editor property is included, but the required attribute is overwritten to false. Thus, which makes the property editor would be property optional. But there are However, the two secondary object types included noeditor and witheditor, that might may have specified different values values specified for the required attribute of the editor property editor.

Code Block
languageymlxml
titleObject Document type definition and secondary object type definitions
linenumberstrue
<propertyStringDefinition>
    <id>editor</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>true</required>
</propertyStringDefinition>

<typeDocumentDefinition>
    <id>imported3</id>
    <baseId>system:document</baseId>
    <propertyReference required="false">name<>editor</propertyReference>
    <contentStreamAllowed>allowed</contentStreamAllowed>
    <secondaryObjectTypeId static="false">invoice<>noeditor</secondaryObjectTypeId>
    <secondaryObjectTypeId static="false">deliverySlip<>witheditor</secondaryObjectTypeId>
</typeDocumentDefinition>

<typeSecondaryDefinition>
    <id>noeditor</id>
    <baseId>system:secondary</baseId>
    <propertyReference required="false">editor</propertyReference>
</typeSecondaryDefinition>
 
<typeSecondaryDefinition>
    <id>witheditor</id>
    <baseId>system:secondary</baseId>
    <propertyReference>editor</propertyReference>
</typeSecondaryDefinition>

The definition of the secondary object type noeditor overwrites the required attribute of the property editor to  property to false. This value equals the specification in the imported3 object document type definition. In contrast, the definition of witheditor includes the editor property editor by means of a propertyReference but does not explicitly specify a value for the required attribute. This means , that the value true from the property definition will be used for witheditor. Since the object type imported3 includes noeditor and witheditor at the same time, the dominating value of the required attribute for editor will be taken into account. Since true dominates over false, for the objects of type imported3, the property editor will be mandatory.

...

languageyml
titleDifferent secondary object type definitions
linenumberstrue

...

If a document of type imported3 has none of the two secondary object types, the editor property is optional.
If a document of type imported3 has the secondary object type noeditor, nothing changes. The editor property is still optional.
But if a document of type imported3 has the secondary object type witheditor, the property editor is mandatory in this object.

Summary

This tutorial gave an introduction into the possibilities provided by the option of overwriting the required attribute of properties. Since this topic plays a role in the handling of the schema, also the following pages might be interesting for to you.

Info
iconfalse

Read on

Section


Column
width25%

Managing the Schema

Insert excerpt
Managing the Schema
Managing the Schema
nopaneltrue
 Keep reading


Column
width25%

Schema - Defining Object Types

Insert excerpt
Schema - Defining Object Types
Schema - Defining Object Types
nopaneltrue
 Keep reading


Column
width25%

DMS Endpoints

To update the instance of an object type with the property group of a floating secondary object type as well as specific values use one of the two endpoints for updating metadata. Keep reading



...