Assets

Assets leiten sich vom gewählten Template ab und stellen die einzelnen Stammdatenelemente dar.

Asset erstellen

per API Call

Genau wie Templates können auch Assets per API Call angelegt werden.
Siehe auch Data Management API.

Asset erstellen
<api>
    <organizationId>Virtimo</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>asset</context>
            <method>create</method>
            <parameters>
                <asset>
                    <version>
                        <childTemplates />
                        <customId>Benutzerdefinierte ID</customId>
                        <description></description>
                        <versionedAttributes>
                            <attribute>
                                <key>key1</key>
                                <value>val1</value>
                            </attribute>
                            <attribute>
                                <key>key2</key>
                                <value>val2</value>
                            </attribute>
                        </versionedAttributes>
                    </version>
                    <unversionedAttributes />
                </asset>
                <templateId>40</templateId>
            </parameters>
        </request>
    </requests>
</api>

im BPC

Assets können in der BPC-Oberfläche erstellt werden, sofern bereits mindestens ein Template vorhanden ist.
Siehe Daten anlegen.

Asset bearbeiten

per API Call

Update über ID
<api>
    <organizationId>Virtimo</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>asset</context>
            <method>update</method>
            <parameters>
                <asset>
                    <version>
                        <childTemplates/>
                        <customId>NEU3</customId>
                        <description></description>
                        <versionedAttributes>
                            <attribute>
                                <key>newID</key>
                                <value></value>
                            </attribute>
                        </versionedAttributes>
                    </version>
                    <unversionedAttributes/>
                    <id>483</id>
                </asset>
            </parameters>
        </request>
    </requests>
</api>
Update über CustomID
<api>
    <organizationId>Virtimo</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>asset</context>
            <method>update</method>

            <parameters>
                <asset>
                    <version>
                        <customId>asset_custom_id_6</customId>
                        <template>
                            <customId>template_custom_id_1</customId>
                        </template>
                        <childTemplates/>
                        <description></description>
                        <versionedAttributes>
                            <attribute>
                                <key>VirtimoID</key>
                                <value>val1</value>
                            </attribute>
                        </versionedAttributes>
                    </version>
                    <unversionedAttributes/>
                </asset>
            </parameters>
        </request>
    </requests>
</api>

im BPC

In der BPC-Oberfläche werden Assets, also Stammdatenelemente, direkt über die Stammdatendetails aktualisiert.
Siehe Daten bearbeiten.

Attributeigenschaften

Property Beschreibung Beispiel

key*

Primärschlüssel, der ein Attribut identifiziert.
Falls "labels" oder "displayName" nicht angegeben sind, werden diese Werte durch "key" belegt.

<key>status</key>

attributes

Ein Attribut der Klasse "complex" oder "group" kann Sub-Attribute enthalten. In einem bestimmten Asset lautet die Struktur ./attribute/attributes/* für ein Attribut des Typs "group".

value

Wert eines Attributs. Kann ein Textknoten (für ein Attribut vom Typ "basic") oder ein Elementknoten (für ein Attribut eines beliebigen Typs der Klasse "complex") sein.

Assets Filtern

Man kann zwischen den Methoden get und query unterscheiden. Die Methode get eignet sich vor allem, wenn Sie bereits im spezifischen Wissen, welche Assets Sie benötigen, da es sich um eine spezifische Abfrage anhand der IDs handelt. Mit der query-Methode selektieren Sie anhand von Ihren gesuchten Attributen bestimmte Assets.

Unterschied zwischen Get und Query

Diese Felder werden ausschließlich bei der get Anfrage zusätzlich zurückgesendet. Der Unterschied zwischen den beiden Anfragen beläuft sich auf die Historie und nicht versionierte Attribute.

  • allVersions

  • activeVersion

  • unversionedAttributes

Get-Methode

Die Get-Methode filtert nach Assets anhand der Parameter id, customId + templateId und customId + templateCustomId.

Get-Anfrage mit Asset id
<api>
	<organizationId>supermarkt</organizationId>
	<locale>de</locale>
	<requests>
		<request>
			<context>asset</context>
			<method>get</method>
			<parameters>
          		<id>537</id>
			</parameters>
		</request>
    </requests>
</api>
Get-Anfrage mit customId + templateId
<api>
	<organizationId>supermarkt</organizationId>
	<locale>de</locale>
	<requests>
		<request>
			<context>asset</context>
			<method>get</method>
			<parameters>
                <templateId>55</templateId>
                <customId>Beispiel Mineralwasser</customId>
			</parameters>
		</request>
    </requests>
</api>
Get-Anfrage nach mehreren spezifischen Assets
<api>
	<organizationId>supermarkt</organizationId>
	<locale>de</locale>
	<requests>
		<request>
			<context>asset</context>
			<method>get</method>
			<parameters>
          		<id>537</id>
			</parameters>
		</request>
         <request>
			<context>asset</context>
			<method>get</method>
			<parameters>
          		<id>534</id>
			</parameters>
		</request>
    </requests>
</api>

Query-Methode

Allgemeiner Aufbau von Filter/Sorter abfragen
<api>
    <organizationId>organizationID</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>asset/template</context>
            <method>query</method>
            <parameters>
                  <sparse>true/false</sparse>
                  <getActions>true/false</getActions>
			      <verbosity>0</verbosity> (integers above the selected number)
                  <withoutHiddenAttributes>true/false</withoutHiddenAttributes>
                  <limit>120</limit> (paging limit)
                  <start>0</start> (paging start)
                  <sorters>
                    <sorter>
                    <key>Jedes Attribut im Asset</key>
                    <direction>asc/desc</direction>
                    </sorter>
                  </sorters>
                  <filters>
                    <filter>
                        <key>Jedes Attribut im Asset</key>
                        <operator>Filter Class Operator</operator>
                        <value>Gesuchter Wert</value>
                    </filter>
                  </filters>
            </parameters>
        </request>
    </requests>
</api>

Mit der Query-Methode können Sie spezifische Abfragen definieren und filtern.

Alle Assets dieses Templates
<api>
    <organizationId>supermarkt</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>asset</context>
            <method>query</method>
            <withUser>false</withUser>
            <parameters>
                <filters>
              <filter>
                <key>template.id</key>
                <operator>=</operator>
                <value>54</value>
              </filter>
            </filters>
            </parameters>
        </request>
    </requests>
</api>

Filter Klassen

Klasse Typ Operations BPC Ansicht

id
(von Asset)

number

=, in, not in, !=

- Anzeigefeld und Schaltfläche zum Öffnen des Dialogs „Asset auswählen“
- displayName des ausgewählten Assets wird im Anzeigefeld angezeigt

boolean

boolean

=, !=

CheckBox

date

date

=, < =, <, !=, >, >=

Date field

dateTime

dateTime

< =, <, >, >=

In date und time fields

enum

String

=, in, not in, !=

ComboBox (Multi-selection enabled)

number

number

=, < =, <, !=, >, >=, in, not in

Zahlenrad

string

string

=, contains, contains not, !=

Textfeld

templateId

number

=, in, not in, !=

- Anzeigefeld und Schaltfläche zum Öffnen des Dialogs „Template auswählen“
- displayName des ausgewählten Templates wird im Anzeigefeld angezeigt

time

time

< =, <, >, >=

Time field

userId

number

=, in, not in, !=

ComboBox mit allen displayNames von allen Benutzern der Organisation

Assets Verlinken

Beispiele

Erstellt Suchfilter in der BPC Benutzeroberfläche über API Call
Beispiel Template - Auszug
<api>
    <organizationId>supermarkt</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>query</context>
            <method>create</method>
            <parameters>
                <query>
                    <visibility>user</visibility>
                    <description>Suchkriterien1</description>
                    <filters>
                        <filter>
                            <key>displayName</key>
                            <operator>contains</operator>
                            <value>ID</value>
                        </filter>
                    </filters>
                </query>
                <return>true</return>
            </parameters>
            <withUser>false</withUser>
        </request>
    </requests>
</api>
Filter nach allen gespeicherten Suchfiltern
Beispiel Template - Auszug
<api>
    <organizationId>EZY_ONE</organizationId>
    <locale>de</locale>
    <requests>
        <request>
            <context>query</context>
            <method>query</method>
            <parameters>
            </parameters>
            <withUser>false</withUser>
        </request>
    </requests>
</api>
Template und abgeleitetes Asset für Attribut "enum"
Beispiel Template - Auszug
<attribute>
    <key>state</key>
    <labels>
        <de>Zustand</de>
        <en>State</en>
    </labels>
    <type>enum</type>
    <readOnly>true</readOnly>
    <enums>
        <enum>
            <colorCode><value>00FF00</value></colorCode>
            <key>connected</key>
            <labels>
                <de>Verbunden</de>
                <en>Connected</en>
            </labels>
        </enum>
        <enum>
            <colorCode><value>FF0000</value></colorCode>
            <key>disconnected</key>
            <labels>
                <de>Getrennt</de>
                <en>Disconnected</en>
            </labels>
        </enum>
    </enums>
</attribute>
Beispiel für abgeleitetes Asset - Auszug
<attribute>
    <key>state</key>
    <value>connected</value>
</attribute>
Template und abgeleitetes Asset für Attribut "group"
Beispiel-Template - Auszug
<attribute>
    <key>configuration</key>
    <labels>
        <de>Konfiguration</de>
        <en>Configuration</en>
    </labels>
    <type>group</type>
    <attributes>
        <attribute>
            <key>nominalPower</key>
            <labels>
                <de>Nennleistung</de>
                <en>Nominal Power</en>
            </labels>
            <unit>kW</unit>
            <type>number</type>
        </attribute>
        <attribute>
            <key>minimumPower</key>
            <labels>
                <de>Minimalleistung</de>
                <en>Minimum Power</en>
            </labels>
            <unit>kW</unit>
            <type>number</type>
        </attribute>
    </attributes>
</attribute>
Beispiel für abgeleitetes Asset - Auszug
<attribute>
    <key>configuration</key>
    <attributes>
        <attribute>
            <key>nominalPower</key>
            <value>100000</value>
        </attribute>
        <attribute>
            <key>minimumPower</key>
            <value>80000</value>
        </attribute>
    </attributes>
</attribute>
Template und abgeleitetes Asset für Attribut "list"
Beispiel-Template - Auszug
<attribute>
    <key>notes</key>
    <labels>
        <de>Notizen</de>
        <en>Notes</en>
    </labels>
    <type>list</type>
    <unique>true</unique>
    <maxQuantity>10</maxQuantity>
    <attribute>
        <type>string</type>
        <maxLength>100</maxLength>
    </attribute>
</attribute>
Beispiel für abgeleitetes Asset - Auszug
<attribute>
    <key>notes</key>
    <value>
        <items>
            <item>Milch</item>
            <item>Birnen</item>
            <item>Kaffee</item>
        </items>
    </value>
</attribute>
Template und abgeleitetes Asset für Attribut "table"
Beispiel-Template - Auszug
<attribute>
    <key>flowers</key>
    <labels>
        <de>Blumen</de>
        <en>Flowers</en>
    </labels>
    <type>table</type>
    <maxQuantity>10</maxQuantity>
    <attributes>
        <attribute>
            <key>name</key>
            <labels>
                <de>Name</de>
                <en>Name</en>
            </labels>
            <type>string</type>
            <required>true</required>
        </attribute>
        <attribute>
            <key>color</key>
            <labels>
                <de>Farbe</de>
                <en>Color</en>
            </labels>
            <type>string</type>
        </attribute>
        <attribute>
            <key>quantity</key>
            <labels>
                <de>Anzahl</de>
                <en>Quantity</en>
            </labels>
            <type>number</type>
            <decimalPlaces>0</decimalPlaces>
        </attribute>
    </attributes>
</attribute>
Beispiel für abgeleitetes Asset - Auszug
<attribute>
    <key>flowers</key>
    <value>
        <rows>
            <row>
                <name>Glockenblume</name>
                <color>Gelb</color>
                <quantity>5</quantity>
            </row>
            <row>
                <name>Tulpe</name>
                <color>Lila</color>
                <quantity>10</quantity>
            </row>
            <row>
                <name>Nelke</name>
                <color>Weiß</color>
                <quantity>5</quantity>
            </row>
        </rows>
    </value>
</attribute>