Assets
Assets are derived from the selected Template and represent the individual master data elements.
Create asset
via API call
Just like templates, assets can also be created via API call.
See also Data Management API.
Create asset
<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>
in the BPC
Assets can be created in the BPC interface if at least one template has already been created Template already exists.
See Create data.
Edit asset
via API call
Update via 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 via 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>
in the BPC
In the BPC interface, assets, i.e. master data elements, are updated directly via the master data details.
See Edit data.
Attribute properties
| Property | Description | Example |
|---|---|---|
|
Primary key that identifies an attribute. |
|
|
An attribute of the "complex" or "group" class can contain sub-attributes.
In a specific asset, the structure is |
|
|
Value of an attribute. Can be a text node (for an attribute of the type "basic") or an element node (for an attribute of any type of the class "complex"). |
Filtering assets
A distinction can be made between the methods get and query.
The get method is particularly suitable if you already know specifically which assets you need, as it is a specific query based on the IDs.
With the query method, you select certain assets based on the attributes you are looking for.
Difference between Get and Query
These fields are only returned additionally with the get query.
The difference between the two queries is the history and non-versioned attributes.
-
allVersions
-
activeVersion
-
unversionedAttributes
Get method
The Get method filters for assets using the Parameters id, customId + templateId and customId + templateCustomId.
Get request with 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 request with 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 request for multiple specific 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 method
General structure of query filter/sorter
<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>
You can use the query method to define and filter specific queries.
All assets of this template
<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 classes
| Class | Type | Operations | BPC View |
|---|---|---|---|
id |
number |
=, in, not in, != |
- display field and button to open the "Select asset" dialog |
boolean |
boolean |
=, != |
CheckBox |
date |
date |
=, < =, <, !=, >, >= |
Date field |
dateTime |
dateTime |
< =, <, >, >= |
In date and time fields |
enum |
String |
=, in, not in, != |
ComboBox (Multi-selection enabled) |
number |
number |
=, < =, <, !=, >, >=, in, not in |
Number wheel |
string |
string |
=, contains, contains not, != |
Text field |
templateId |
number |
=, in, not in, != |
- display field and button to open the "Select template" dialog |
time |
time |
< =, <, >, >= |
Time field |
userId |
number |
=, in, not in, != |
ComboBox with all displayNames of all users of the organization |
Examples
Creates search filters in the BPC user interface via API call
<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 for all saved search filters
<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 and derived asset for attribute "enum"
<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>
<attribute>
<key>state</key>
<value>connected</value>
</attribute>
Template and derived asset for attribute "group"
<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>
<attribute>
<key>configuration</key>
<attributes>
<attribute>
<key>nominalPower</key>
<value>100000</value>
</attribute>
<attribute>
<key>minimumPower</key>
<value>80000</value>
</attribute>
</attributes>
</attribute>
Template and derived asset for attribute "list"
<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>
<attribute>
<key>notes</key>
<value>
<items>
<item>Milch</item>
<item>Birnen</item>
<item>Kaffee</item>
</items>
</value>
</attribute>
Template and derived asset for attribute "table"
<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>
<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>