diff --git a/content/api/_index.md b/content/api/_index.md index 5270292..11fe656 100644 --- a/content/api/_index.md +++ b/content/api/_index.md @@ -31,10 +31,14 @@ stored in the respective ElementMaps in their Strolch realm. Thus accessing a certain parameter from a Resource would look like this: ```java -try (StrolchTransaction tx = openTx(realmName)) { - Resource resource = tx.getResourceBy("TestType", "MyTestResource"); - Date date = resource.getDate("@bag01", "@param6"); - logger.info("@param6 date is " + date); +public class Test { + public static void main(String[] args) { + try (StrolchTransaction tx = openTx(realmName)) { + Resource resource = tx.getResourceBy("MyType", "myResource"); + Date date = resource.getDate("myBag", "myParam1"); + logger.info("myParam date has value " + date); + } + } } ``` @@ -42,19 +46,19 @@ XML Presentation of Strolch's top level elements of Resources: ```xml - - - - - + + + + + - - - - - + + + + + - + @@ -66,17 +70,17 @@ XML Presentation of Strolch's top level elements of Orders: ```xml - - - - - + + + + + - - - - - + + + + + ``` @@ -86,68 +90,54 @@ XML Presentation of Strolch's top level elements of Activities: ```xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - + + - - + + - + + + + + + + + + + + + + + + ``` @@ -171,14 +161,18 @@ Strolch agent implements: back to the persistence layer. This allows for fast in-memory quries, but makes sure no data is lost when the agent is restarted. -Strolch Realms are also responsible for opening Transactions, as these are -bound to the persistence layer configured for this realm. At runtime, a realm -is then accessed from the ComponentContainer: +Strolch Realms are also responsible for opening Transactions, as these are bound +to the persistence layer configured for this realm. At runtime, a realm is then +accessed from the ComponentContainer: + ```java -ComponentContainer container = getAgent().getContainer(); -StrolchRealm realm = container.getRealm(StrolchConstants.DEFAULT_REALM); -try(StrolchTransaction tx = realm.openTx()) { - Resource resource = tx.getResourceBy("TestType", "MyTestResource"); - ... +public class Example { + public static void main(String[] args) { + ComponentContainer container = getAgent().getContainer(); + StrolchRealm realm = container.getRealm(StrolchConstants.DEFAULT_REALM); + try (StrolchTransaction tx = realm.openTx()) { + Resource resource = tx.getResourceBy("TestType", "MyTestResource"); + } + } } ```