Support for entities and inventories
The diesel domain modelling has built-in support for entities. Entities (and assets) have a JSON representation and have a
class and a
key and are persisted and managed by an
domain plugin. These inventories can be defined in a few ways:
You can define classes part of Domain Modelling and bind them to inventories. After that, you can simply use these as entities in flows with CRUD messages, browse them with the built-in diesel browsers etc
Client messages when using the entity support:
"default"as the connection name.
Example (see more in diesel-inv-story):
$send diesel.inv.create (class="TestClass1", entity=tc1) $send diesel.inv.find (class="TestClass1", key="1234") $send diesel.inv.update (class="TestClass1", entity=tc1) $send diesel.inv.delete (class="TestClass1", key="1234")
If the class can be inferred, it can be left out (for instance the entity knows it's class).
listAll return a structure with two fields:
To use rules based inventories, register the following:
$send diesel.inv.register(inventory="diesel", classes="TestClass1") $send diesel.inv.connect(inventory="diesel", connection="default")