Skip to content

Setting up Relatics Reports and Webservices

Introduction

In order to extract all Element data a very specific relatics report and webservice needs to be setup. This webservice will be used by the relatics_toolkit.extract_element_tables function in order to produce the full extraction.

The function will do the following:

  • Loop over the provided ElementID list to be extracted.
  • Produce a table with the Name, Description, RichText and GUID of the Element, append all properties, and append all relations with a to-one cardinality.
  • Produce a link table for each relation the element has to other elements with to-many cardinality.
  • Combine all these tables into a dictionary and return it.

Warning!

Don't skip any steps in this setup. Copy names and query patterns exactly. The extract_element_tables method has no flexibility in report part naming and the naming of the query values should therefore match this guide.

Tip

Ensure that after creating a report you enter the output extension to be xml

Setting up the Report structure

The report in relatics needs to be the following structure:

Report structure

Element

This Part is the entry point for the extractor, it takes the ConfigurationOfRef of the desired, to be extracted, element as parameter and will generate the report from this information. The R1Element and R1ElementID are important pieces of information to cleanly construct the tables.

Report structure

Report structure

ElementInstances

The Table for element instances will be used to generate the element table with information about the element itself. and you set it up like this:

Element Instances

Properties

This table gives you the information about all properties that could exist. This is needed to make a consistent table with all possible fields present, even when they're empty.

Element Instances

Below are the node details for each node in the query:

R1Element:

Nothing is selected in this section, the only relevant part is in the constraint: Property node constraint

Property:

Property node constraint Property node constraint

PropertyInstances

This table returns the actual properties with their value. Set it up like this. Property Instances query

R1Instance:

You set up the constraint and advanced fields.

Property Instances R1Instance

PropertyInstance:

You set up the Advanced fields an Join Editor.

Property Instances PropertyInstance

Property Instances PropertyInstance join

Relations

This table gives you the possible relations an element can have, akin to the Properties table.

Relation query

R1Element:

Modify Common fields and the Constraint Editor:

Relation node R1Element

Relation:

Modify the Join Editor, Common fields and Advanced fields.

Relation node Relation Relation node Relation Advanced fields

R2Element:

Modify the Common fields, Advanced fields and Join Editor.

Relation node R2Element Relation node R2Element Join Editor

All types:

Relation node alltypes Relation node R2Element alltypes

RelationInstances

This table gives you the actual relations an element has.

Relation Instances query

R1Instance:

Modify the Common fields, Constraint editor and Advandec fields section: Relation Instances R1Instance

Relation:

Modify the Common fields, Join Editor and Advanced fields. Relation Instances Relation

Relation Instances Relation

R2Instance:

Modify the Common fields, Advanced fiels and Join Editor. Relation Instances R2Instance Relation Instances R2Instance join editor

R2Element:

Modify the Common fields, Advanced fields and Join Editor. Relation Instances R2Element Relation Instances R2Element join

R1Element:

Modify Common fields and Join Editor. Relation Instances R1Element