# Strolch Overview on Strolch

https://strolch.li/ Recent content in Strolch Overview on Strolch Hugo -- gohugo.io en-us Wed, 14 Jul 2021 20:25:11 +0200

# Strolch PLC now also on Maven Central

https://strolch.li/blog/post-00016/ Fri, 01 Jan 2021 00:00:00 +0100 https://strolch.li/blog/post-00016/Strolch PLC now also on Maven Central Strolch PLC version 1.0.7 has been deployed to Maven Central for easier integration into your projects To more easily use Strolch PLC in your project, we have now deployed the latest Strolch PLC version to Maven Central. This version 1.0.7 depends on Strolch version 1.6.100. Enjoy coding!

# Release of Strolch 1.6.100

https://strolch.li/blog/post-00015/ Wed, 14 Jul 2021 20:25:11 +0200 https://strolch.li/blog/post-00015/Release of Strolch 1.6.100 The 100. Strolch release of the 1.6 branch and a brand new website! Ok, so Maven doesn&rsquo;t exactly have 100 releases on it, but even though we have been quiet on public releases, Strolch has seen many refactorings, fixes, new features etc. over the past three years of its last release. Some notable changes: I18n Support for StrolchExceptions. Better performance for reports on large joins.

# Strolch Reports

https://strolch.li/blog/post-00014/ Fri, 30 Jun 2017 00:00:00 +0100 https://strolch.li/blog/post-00014/Strolch Reports Strolch can do reports! A feature we haven&rsquo;t written about yet is the report API. Strolch has it&rsquo;s own API to generate reports of data, and since we have a generic model, we use Resource of type Report to define them. Go check out the documentation and then enjoy using this easy way to deliver the reports your peers require.

# Strolch Searches

https://strolch.li/blog/post-00013/ Fri, 30 Jun 2017 00:00:00 +0100 https://strolch.li/blog/post-00013/Strolch Searches Strolch queries are deprecated! Strolch has had once again many changes, and fixes etc. One important thing to note is that we have removed support for transactional mode and have rewritten how models are searched. Thus the search API was born. Go check out the Strolch Search documentation and then go rewrite your searches =)). Strolch tag 1.6.51 has all those juicy changes!

# Wow, the many changes!

https://strolch.li/blog/post-00012/ Tue, 21 Mar 2017 00:00:00 +0100 https://strolch.li/blog/post-00012/Wow, the many changes! So many changes, and so long no update - not good! Oh boy, have we forgotten to update you all on the latest awesome features in Strolch! There are over 123 commits since the last tag 1.3.0, so that alone merits a new blog post. Currently the latest tag is 1.5.5, but this version is actually already quite old, as it was created on 31. January 2017 and there are 53 new commits ahead of the tag.

# Strolch now on Maven Central

https://strolch.li/blog/post-00011/ Thu, 22 Sep 2016 00:00:00 +0100 https://strolch.li/blog/post-00011/Strolch now on Maven Central Release Version 1.3.0 released and deployed to Maven Central We have released a new version of Strolch so that you can now go and use the the latest features in Strolch. Further we have now deployed Strolch to Maven Central, so it is easier than ever to use Strolch in your projects. No need to download first or use a special repository - just define the dependencies as you would any other dependency.

# Versioning of objects

https://strolch.li/blog/post-00010/ Mon, 08 Aug 2016 00:00:00 +0100 https://strolch.li/blog/post-00010/Versioning of objects Opt-In versioning of objects A major new feature has landed in Strolch. Now, using opt-in, it is possible to have all changes to the object model be versioned. This means that any change to Order, Resource or Activity is automatically versioned and one can then revert to this version later on. This will make it far easier to implement undo operations in applications since it is an inherent part of the lifecycle of objects in Strolch.

# Release 1.2.0

https://strolch.li/blog/post-00009/ Mon, 04 Jul 2016 00:00:00 +0100 https://strolch.li/blog/post-00009/Release 1.2.0 Release of Strolch 1.2.0 A few months ago we informed of the soon to be released version 1.1.0. Well, we decided to jump to 1.2.0 because we did some refactorings. All the eitchnet projects have been melted into Strolch and thus now it&rsquo;s all one nice package. This will result in simpler development and less constraints on APIs between the two projects. Other than that, not much changed, but we are continually working on Strolch, so go grab your latest copy and have fun coding!

# Strolch Update

https://strolch.li/blog/post-00008/ Sat, 09 Apr 2016 00:00:00 +0100 https://strolch.li/blog/post-00008/Strolch Update Long due update on Strolch development. Although we have been rather quiet in the last couple of months, anyone viewing Strolch&rsquo;s commit log, will see that we certainly didn&rsquo;t halt Strolch development. We have been hard at work, using Strolch in projects, which required many new features and fixes. The commit log shows as of today over 180 commits since the release tag 1.0.0. Some of the most exciting changes are:

# Activities: Beginning of the planning engine

https://strolch.li/blog/post-00007/ Wed, 08 Jul 2015 00:00:00 +0100 https://strolch.li/blog/post-00007/Activities: Beginning of the planning engine The ground work of the Strolch planning engine has been laid. One of the core ideas in building Strolch was to create a planning engine. The planning engine would work in combination of Order objects representing customer orders, Resource objects representing machines, human resources, etc., and Activity/Action hierarchies defining a workflow. With the latest couple of commits to Strolch we have now added Activities and a basic planning of Actions onto Resources.

# Strolch Documentation

https://strolch.li/blog/post-00006/ Mon, 06 Apr 2015 00:00:00 +0100 https://strolch.li/blog/post-00006/Strolch Documentation Any good software has some decent documentation explaining concepts, best practices and gives examples. So this post is to announce that there is now a new page on Strolch&rsquo;s website with a bit of documentation. This first documentation explains the Strolch runtime and some of the do and don&rsquo;t in Strolch code. Bear with us, writing documentation takes time and can be outdated quickly, so we will make an effort to keep everything up to date and add more documentation, but this is a start.

# Strolch Release 1.0.0

https://strolch.li/blog/post-00005/ Tue, 31 Mar 2015 00:00:00 +0100 https://strolch.li/blog/post-00005/Strolch Release 1.0.0 Finally Version 1.0.0 of Strolch has been released and can be downloaded immediately. Before 1.0.0 could be released, some major changes were decided, all driven by the first big project using Strolch as its underlying stack. Those changes were minor, and really major, but should make Strolch better and was important for the first release. Here is a list of the most interesting changes: Java 8 - Strolch was ported to Java 8.

# DurationParameter and other minor changes: Release 1.0.0-RC4

https://strolch.li/blog/post-00004/ Thu, 09 Oct 2014 00:00:00 +0100 https://strolch.li/blog/post-00004/DurationParameter and other minor changes: Release 1.0.0-RC4 New DurationParameter and additional minor changes: Release of 1.0.0-RC4 which can be downloaded on the download page. While implementing a use case in a Strolch based application it was detected that an essential parameter type was missing, the DurationParameter. This parameter currently stores the value as a long in memory and serializes to ISO8601. As soon as we move Strolch to Java8, we will change this to use the Period class in the new Java8 date and time API.

# DB Initialization: Release 1.0.0-RC3

https://strolch.li/blog/post-00003/ Sun, 24 Aug 2014 00:00:00 +0100 https://strolch.li/blog/post-00003/DB Initialization: Release 1.0.0-RC3 Important feature Database Initialization added: Release of 1.0.0-RC3 which can be downloaded on the download page. When living continuous integration and continuous delivery, it is vital that things like database migrations and initialization are performed in a controlled, but automatic way. A Strolch-based application is using the PostgreSQL persistence layer. The implementation understands the concepts of migration, and validating the database schema, but currently a mechanism to automatically initialize the database with a minimal set of data was missing.

# Release 1.0.0-RC2

https://strolch.li/blog/post-00002/ Fri, 22 Aug 2014 00:00:00 +0100 https://strolch.li/blog/post-00002/Release 1.0.0-RC2 Scratch that RC1, here is the brand new 1.0.0-RC2 which can be downloaded on the download page. So, as expected there were a few bugs, for instance the Strolch tutorial apps didn&rsquo;t start, so now i fixed those and released an RC2. Go get it and give it a try!

# Release 1.0.0-RC1

https://strolch.li/blog/post-00001/ Wed, 20 Aug 2014 00:00:00 +0100 https://strolch.li/blog/post-00001/Release 1.0.0-RC1 With the Go-Live of a Strolch-based application around the corner, it is time to release Version 1.0.0 of Strolch. To this affect we have now released version 1.0.0-RC1 which can be downloaded on the download page. Story Strolch as a component based software agent has been two years in the making. The concepts in Strolch have been taken from a proprietary planning, scheduling and controlling software agent, which was, and is been, used in industrial automation, logistics and production.

# Architecture

https://strolch.li/documentation/architecture/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/architecture/Architecture Birds View A Strolch agent&rsquo;s architecture can be seen as a simple three-tier architecture. The presentation layer is mostly a web frontend, where the communication with the agent is done via REST API calls. The agent itself implements the business logic using Services, Commands, Queries etc. The agent can communicate with other 3rd systems using any API, where it is preferred to use JSON over REST. The agent can use a standard RDBMS as a storage system, where currently DAOs have been implemented only for PostgreSQL.

# Configuration

https://strolch.li/tutorial/configuration/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/tutorial/configuration/Configuration Let&rsquo;s start by creating a new Apache Maven project. We&rsquo;ll need a POM with the proper dependencies. We expect you to be familiar with Apache Maven, so we&rsquo;ll just show you a working POM file: pom.xml &lt;?xml version=&#34;1.0&#34;?&gt; &lt;project xmlns=&#34;http://maven.apache.org/POM/4.0.0&#34; xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; xsi:schemaLocation=&#34;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&#34;&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;li.strolch&lt;/groupId&gt; &lt;artifactId&gt;strolch-bookshop&lt;/artifactId&gt; &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;name&gt;strolch-bookshop&lt;/name&gt; &lt;description&gt;Bookshop built on Strolch&lt;/description&gt; &lt;inceptionYear&gt;2017&lt;/inceptionYear&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;maven.build.timestamp.format&gt;yyyy-MM-dd HH:mm:ss&lt;/maven.build.timestamp.format&gt; &lt;buildTimestamp&gt;${maven.build.timestamp}&lt;/buildTimestamp&gt; &lt;jdk.version&gt;1.8&lt;/jdk.version&gt; &lt;jersey.version&gt;2.25.1&lt;/jersey.version&gt; &lt;slf4j.version&gt;1.7.25&lt;/slf4j.version&gt; &lt;logback.version&gt;1.2.3&lt;/logback.version&gt; &lt;petitparser.version&gt;2.1.0&lt;/petitparser.version&gt; &lt;hikaricp.version&gt;2.7.1&lt;/hikaricp.version&gt; &lt;postgresql.version&gt;42.1.4&lt;/postgresql.version&gt; &lt;gson.version&gt;2.8.2&lt;/gson.version&gt; &lt;annotation.version&gt;1.3.1&lt;/annotation.version&gt; &lt;javaxmail.version&gt;1.6.0&lt;/javaxmail.version&gt; &lt;serverlet.

# Model

https://strolch.li/documentation/model/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/model/Model Before we dive into the entire model, let&rsquo;s show an example and how it would be modelled in Strolch and use in Strolch: The model has four entities, which will be modelled using 3 Resources and 1 Order object. The objects have numerous fields and the following relationships: Bidirectional between Article &lt;-&gt; Product Unidirectional from Order -&gt; Article Unidirectional from Order -&gt; Customer A possible model would look as follows:

# Model

https://strolch.li/tutorial/model/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/tutorial/model/Model Looking back at our functionality, we can list the following entities that need to be modelled (We&rsquo;ll go into detail further down): Book → books can be orderd UserCart → we want to store the cart of the user Account → we need to know where to send the orders PurchaseOrder → we need to know what was ordered and keep track of its state FromStock → we want to use activities to implement the process of an order In Strolch we model entities by defining the element as a template.

# CRUD Book

https://strolch.li/tutorial/crud-book/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/tutorial/crud-book/Preparation Since Books are central to the bookshop, we&rsquo;ll first create the CRUD REST API for them. The API will be as follows: GET ../rest/books?query=,offset=,limit= GET ../rest/books/{id} POST ../rest/books PUT ../rest/books/{id} DELETE ../rest/books/{id} Thus corresponding with querying, getting, creating, updating and removing of books. So let&rsquo;s go ahead and add these REST APIs to our project. Our project is using JAX-RS 2.0 as the API and Jersey 2.x as the implementation, thus first we need to configure JAX-RS.

# Do and Don't

https://strolch.li/documentation/do-and-donts/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/do-and-donts/This page discusses things you should and shouldn&rsquo;t do when using Strolch The following is a simple list of do&rsquo;s and don&rsquo;ts: 1 Service per use-case, should mostly delegate to Commands. Commands implement use-cases or parts of it, and are thus reusable. Subclass ResourceSearch, OrderSearch and ActivitySearch when implementing use-case specific search - this allows privilege checking. One Transaction at a time - no TX inside of another TX.

# Runtime Configuration

https://strolch.li/documentation/runtime-configuration/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/runtime-configuration/Runtime Configuration A Strolch runtime configuration comprises two parts: a configuration part, and a model part. The configuration are files located in the ..config/ folder, and the model are files located in the ../data folder. In an absolute minimal configuration, the Strolch runtime requires the following folder structure: ../config/ ../StrolchConfiguration.xml → configures the Strolch agent ../PrivilegeConfig.xml → configures user management ../PrivilegeUsers.xml → contains the users in an XML based user management file .

# Architecture

https://strolch.li/plc/architecture/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/plc/architecture/Architecture Overview The Strolch PLC architecture sees the Strolch Agent as the server, managing logical devices, i.e. multiple sensors and actors together and thus deciding on further steps. With this architecture multiple PLCs can be combined together in one agent for flow control. PLC Architecture On the agent side the two main classes are the PlcGwServerHandler and the PlcGwService The PlcGwServerHandler handles connections from remote PLCs over WebSockets and sends the requests to these PLCs.

# Realms

https://strolch.li/documentation/realms/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/realms/Realms Realms implement multi-tenant capabilities. A Strolch agent can have an arbitrary number of realms configured and each realm has its own persistence configuration, allowing to separate mandates completely. A realm can run in one of the following modes: EMPTY This is a transient data store mode, where no model changes are persisted - they are only kept in memory. When the Strolch agent is started, this realm is empty as no data is loaded.

# Components

https://strolch.li/documentation/components/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/components/Components A Strolch agent can be easily extended with arbitrary components. An agent is basically a container for classes extending StrolchComponent with a life cycle. These classes mostly implement an interface which describes the operations that are supported by the component. The following represents a list of the most used components: RealmHandler: li.strolch.agent.impl.DefaultRealmHandler PrivilegeHandler: li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler EnumHandler: li.strolch.runtime.query.enums.DefaultEnumHandler PolicyHandler: li.strolch.policy.DefaultPolicyHandler ServiceHandler: li.strolch.service.api.DefaultServiceHandler StrolchSessionHandler: li.strolch.rest.DefaultStrolchSessionHandler PersistenceHandler: multiple implementations PostInitializer: project specific implementation MailHandler: li.

# Services and Commands

https://strolch.li/documentation/services-and-commands/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/services-and-commands/Services and Commands Services are written to implement a specific use-case. Commands are written to implement re-usable parts of a use-case. The use-case can be abstract e.g., AddResourceService or very specific e.g. CreatePatientService. Should the use-case be re-usable in different scenarios, then commands should implement the logic, and the services should then execute the commands. E.g. The CreatePatientService would use a CreatePatientResourceCommand and then use an AddResourceCommand in a single transaction, so that the task of creating the actual Patient Resource can be re-used somewhere else.

# Searches

https://strolch.li/documentation/searches/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/searches/Searches As is custom for every framework, querying, or searching, the model must be possible. Strolch searches are implemented using the StrolchSearch class and one of its concrete implementations: ResourceSearch, OrderSearch, ActivitySearch. A Strolch element always has two identifiers: Type and Id. The type is important as it classifies an element. So if a car and a house would be modelled in Strolch, then those would both be a Resource, but one of type Car and the other of type House.

# Queries

https://strolch.li/documentation/queries/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/queries/Queries The Query API is deprecated and the search API should be used instead. As is custom for every framework, querying the model must be possible. Strolch queries are implemented using the StrolchQuery interface and one of its concrete implementations: ResourceQuery, OrderQuery, ActivityQuery. A Strolch element always has two identifiers: Type and Id. The type is important as it classifies an element. So if a car and a house would be modelled in Strolch, then those would both be a Resource, but one of type Car and the other of type House.

# Example Set-Up

https://strolch.li/plc/example-set-up/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/plc/example-set-up/Example Set-Up This example setup describes the movement of containers over conveyors. The conveyors have motors which can be started and stopped by a GPIO output pin controlled on a Raspberry Pi and each conveyor has a light barrier to detect the occupancy of a container and the Raspberry Pi detects this on GPIO input pins. Further at each conveyor location is a barcode reader to read the ID of a container.

# Transactions

https://strolch.li/documentation/transactions/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/transactions/Transactions Strolch Transactions play a central role in a Strolch agent. A transaction is opened for a realm, and grants access to the model of the agent. Transactions are implemented as a Java try-with-resources by implementing the AutoCloseable interface. This makes it trivial to understand the scope of a transaction. Transactions handle the following: Opening and closing database connections Releasing locks to strolch elements, if tx.lock(StrolchRootElement) or tx.lock(Locator) was called Performing Commands by executing them in the added order, and validating them first.

# Policies

https://strolch.li/documentation/policies/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/policies/Policies Policies are an integral part when writing business logic in Strolch. In many cases it would suffice to write all such logic in Services and Commands, but as soon as behaviour can change, depending on the element being accessed, then this would quickly lead to many if/else blocks. Since writing large if/else blocks is not maintanable in the long run, Strolch offers a different approach. All Strolch elements can store Policy definitions.

# Observers

https://strolch.li/documentation/observers/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/observers/Observers All changes done in a Strolch transaction are recorded and then propagated to any registered observers. The observer feature is opt-in and is configured for each realm. In the StrolchConfiguration.xml file enable observers by adding the enableObserverUpdates property per realm: &lt;StrolchConfiguration&gt; &lt;env id=&#34;dev&#34;&gt; ... &lt;Component&gt; &lt;name&gt;RealmHandler&lt;/name&gt; &lt;api&gt;li.strolch.agent.api.RealmHandler&lt;/api&gt; &lt;impl&gt;li.strolch.agent.impl.DefaultRealmHandler&lt;/impl&gt; &lt;depends&gt;PrivilegeHandler&lt;/depends&gt; &lt;Properties&gt; &lt;realms&gt;defaultRealm, otherRealm&lt;/realms&gt; &lt;enableObserverUpdates&gt;true&lt;/enableObserverUpdates&gt; &lt;dataStoreMode&gt;TRANSIENT&lt;/dataStoreMode&gt; &lt;dataStoreFile&gt;StrolchModel.xml&lt;/dataStoreFile&gt; &lt;enableObserverUpdates.otherRealm&gt;true&lt;/enableObserverUpdates.otherRealm&gt; &lt;dataStoreMode.otherRealm&gt;TRANSIENT&lt;/dataStoreMode.otherRealm&gt; &lt;dataStoreFile.otherRealm&gt;StrolchModel.xml&lt;/dataStoreFile.otherRealm&gt; &lt;/Properties&gt; &lt;/Component&gt; &lt;/env&gt; ... &lt;/StrolchConfiguration&gt; Registering for updates is done by registering an Observer on the ObserverHandler of the realm itself:

# Versioning

https://strolch.li/documentation/versioning/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/versioning/Versioning One of Strolch&rsquo;s features that sets it apart from other frameworks, is that versioning is baked into Strolch&rsquo;s fabric. The feature is opt-in, as it is not required in all projects, but it only needs enabling, for all modifications to objects to be versioned, so that rollbacks can be done when needed. The feature is enabled for each realm. In the StrolchConfiguration.xml file enable it by adding the enableVersioning propery per realm:

# Reports

https://strolch.li/documentation/reports/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/reports/Reports Since Strolch has a generic model, it was rather straight forward to create a simple API for writing reports. In Strolch a report is defined by using its own model, i.e. a Report is a Resource of type Report. A report consists of the following parts: policy definition, thus allowing extensions basic configuration like base object type, order direction, etc. column definitions joins ordering definition filters An example of a report is as follows:

# Privileges

https://strolch.li/documentation/priviles/ Mon, 01 Jan 0001 00:00:00 +0000 https://strolch.li/documentation/priviles/Privileges No framework is complete without user management and privilege validation. The basic form would be Users and Roles, and then validating that an authenticated user has a given role. In Strolch we go a step further: A User has roles assigned, and each role has a set of Privileges. The privileges can overlap, a validation is performed to make sure that the one role doesn&rsquo;t deny and another role allows a specific action.