strolch-website/docs/index.json

1 line
204 KiB
JSON
Raw Normal View History

2021-07-11 20:37:40 +02:00
[{"uri":"https://strolch.li/api/","title":"API","tags":[],"description":"","content":"Overview The Strolch API revolves around the StrolchTransaction object. The main concept is to implement your use cases in Service implementations. You open a transaction using the openTx(String)-method and then perform the use case by adding your Command instances to the transaction.\nTransactions are opened on a StrolchRealm. The realms are used to separate mandates in a single runtime instance of Strolch. Each realm has its own ResourceMap, OrderMap, ActivityMap instances from which the TX retrieves the elements.\nModel The Strolch model is implemented in the project li.strolch.model.\nThe Strolch model consists of three root level elements: Resource, Order and Activity. Each element has at least the following attributes:\n Id the element\u0026rsquo;s id Name the element\u0026rsquo;s name Type the element\u0026rsquo;s type Each root element can have any number of ParameterBag instances on it, which in turn can have any number of Parameters on it. Accessing these objects is always done by their IDs. Strolch root elements are always stored in the respective ElementMaps in their Strolch realm. Thus accessing a certain parameter from a Resource would look like this:\ntry (StrolchTransaction tx = openTx(realmName)) { Resource resource = tx.getResourceBy(\u0026#34;TestType\u0026#34;, \u0026#34;MyTestResource\u0026#34;); Date date = resource.getDate(\u0026#34;@bag01\u0026#34;, \u0026#34;@param6\u0026#34;); logger.info(\u0026#34;@param6 date is \u0026#34; + date); } XML Presentation of Strolch\u0026rsquo;s top level elements of Resources:\n\u0026lt;!-- Resource instance --\u0026gt; \u0026lt;Resource Id=\u0026#34;MyTestResource\u0026#34; Name=\u0026#34;Test Name\u0026#34; Type=\u0026#34;TestType\u0026#34;\u0026gt; \u0026lt;ParameterBag Id=\u0026#34;@bag01\u0026#34; Name=\u0026#34;Test Bag\u0026#34; Type=\u0026#34;TestBag\u0026#34;\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param7\u0026#34; Name=\u0026#34;StringList Param\u0026#34; Type=\u0026#34;StringList\u0026#34; Value=\u0026#34;Hello;World\u0026#34; /\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param6\u0026#34; Name=\u0026#34;Date Param\u0026#34; Type=\u0026#34;Date\u0026#34; Value=\u0026#34;2012-11-30T18:12:05.628+01:00\u0026#34; /\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param5\u0026#34; Name=\u0026#34;String Param\u0026#34; Type=\u0026#34;String\u0026#34; Value=\u0026#34;Strolch\u0026#34; /\u0026gt; \u0026lt;/ParameterBag\u0026gt; \u0026lt;ParameterBag Id=\u0026#34;@bag02\u0026#34; Name=\u0026#34;Test Bag\u0026#34; Type=\u0026#34;TestBag\u0026#34;\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param4\u0026#34; Name=\u0026#34;Long Param\u0026#34; Type=\u0026#34;Long\u0026#34; Value=\u0026#34;4453234566\u0026#34; /\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param3\u0026#34; Name=\u0026#34;Integer Param\u0026#34; Type=\u0026#34;Integer\u0026#34; Value=\u0026#34;77\u0026#34; /\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param2\u0026#34; Name=\u0026#34;Float Param\u0026#34; Type=\u0026#34;Float\u0026#34; Value=\u0026#34;44.3\u0026#34; /\u0026gt; \u0026lt;Parameter Id=\u0026#34;@param1\u0026#34; Name=\u0026#34;Boolean Param\u0026#34; Type=\u0026#34;Boolean\u0026#34; Value=\u0026#34;true\u0026#34; /\u0026gt; \u0026lt;/ParameterBag\u0026gt; \u0026lt;TimedState Id=\u0026#34;@integerState\u0026#34; Name=\u0026#34;Integer State\u0026#34; Type=\u0026#34;IntegerState\u0026#34;\u0026gt; \u0026lt;Value Time=\u0026#34;0\u0026#34; Value=\u0026#34;1\u0026#34; /\u0026gt; \u0026lt;Value Time=\u0026#34;1\u0026#34; Value=\u0026#34;2\u0026#34; /\u0026gt; \u0026lt;Value Time=\u0026#34;2\u0026#34; Value=\u0026#34;3\u0026#34; /\u0026gt; \u0026lt;/TimedState\u0026gt; \u0026lt;/Resource\u0026gt; XML Presentation of Strolch\u0026rsquo;s top level elements of Orders:\n\u0026lt;!-- Order instance --\u0026gt; \u0026lt;Order Id=\u0026#34;MyTestOrder\u0026#34; Name=\u0026#34;Test Name\u0026#34; Type=\u0026#34;TestType\u0026#34; Date=\u0026#34;2013-11-20T07:42:57.699Z\u0026#34; State=\u0026#34;CREATED\u0026#34;\u002