2014-09-19 17:18:51 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2015-08-28 14:59:43 +02:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
2018-06-25 11:42:26 +02:00
|
|
|
<meta name="google-site-verification" content="CPhbjooaiTdROm7Vs4E7kuHZvBfkeLUtonGgcVUbTL8" />
|
2015-08-28 14:59:43 +02:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="author" content="">
|
|
|
|
<link rel="shortcut icon" href="ico/favicon.ico">
|
|
|
|
|
|
|
|
<title>Strolch: API</title>
|
|
|
|
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
|
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
|
|
|
<!-- Custom styles for this template -->
|
|
|
|
<link href="css/custom.css" rel="stylesheet">
|
|
|
|
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --><!--[if lt IE 9]>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script><![endif]-->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
|
|
|
<div class="container">
|
|
|
|
<div class="navbar-header">
|
|
|
|
<a class="navbar-brand" href="index.html">Strolch</a>
|
2014-09-19 17:18:51 +02:00
|
|
|
</div>
|
2015-08-28 14:59:43 +02:00
|
|
|
<div class="collapse navbar-collapse">
|
|
|
|
<ul class="nav navbar-nav">
|
|
|
|
<li><a href="index.html">Overview</a></li>
|
|
|
|
<li class="active"><a href="api.html">API</a></li>
|
|
|
|
<li><a href="documentation.html">Documentation</a></li>
|
2020-02-17 14:22:32 +01:00
|
|
|
<li><a href="plc.html">PLC</a></li>
|
2017-05-21 14:06:31 +02:00
|
|
|
<li><a href="tutorial.html">Tutorial</a></li>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li><a href="downloads.html">Downloads</a></li>
|
|
|
|
<li><a href="development.html">Development</a></li>
|
|
|
|
<li><a href="blog.html">Blog</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<!--/.nav-collapse -->
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<div class="container">
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<div class="page-header">
|
|
|
|
<h1 class="page-title">Strolch API</h1>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p class="lead page-description">This page describes the Strolch API.</p>
|
|
|
|
</div>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<div class="content">
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<h2>Overview</h2>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>The Strolch API revolves around the <i>StrolchTransaction</i> object. The main concept is to implement your
|
2018-06-25 11:42:26 +02:00
|
|
|
use cases in <i>Service</i> implementations. You open a transaction using the <i>openTx(String)</i>-method
|
|
|
|
and then perform the use case by adding your <i>Command</i> instances to the transaction.</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>Transactions are opened on a <i>StrolchRealm</i>. The realms are used to separate mandates in a single
|
2018-06-25 11:42:26 +02:00
|
|
|
runtime instance of Strolch. Each realm has its own <i>ResourceMap</i>, <i>OrderMap</i>, <i>ActivityMap</i>
|
|
|
|
instances from which the TX retrieves the elements.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<h2>Model</h2>
|
|
|
|
|
|
|
|
<p>The Strolch model is implemented in the project li.strolch.model.</p>
|
|
|
|
|
|
|
|
<p>The Strolch model consists of three root level elements: <i>Resource</i>, <i>Order</i> and <i>Activity</i>.
|
2018-06-25 11:42:26 +02:00
|
|
|
Each element has at least the following attributes:</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
<ul>
|
|
|
|
<li>Id → the element's id</li>
|
|
|
|
<li>Name → the element's name</li>
|
|
|
|
<li>Type → the element's type</li>
|
|
|
|
</ul>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>Each root element can have any number of <i>ParameterBag</i> instances on it, which in turn can have any
|
2018-06-25 11:42:26 +02:00
|
|
|
number of <i>Parameters</i> on it. Accessing these objects is always done by their IDs. Strolch root elements
|
|
|
|
are always stored in the respective <i>ElementMaps</i> in their Strolch realm. Thus accessing a certain
|
|
|
|
parameter from a <i>Resource</i> would look like this:</p>
|
2017-05-21 14:06:31 +02:00
|
|
|
<pre class="pre-scrollable">
|
2015-08-28 14:59:43 +02:00
|
|
|
try (StrolchTransaction tx = openTx(realmName)) {
|
2014-09-19 17:18:51 +02:00
|
|
|
Resource resource = tx.getResourceBy("TestType", "MyTestResource");
|
|
|
|
DateParameter dateP = resource.getParameter("@bag01", "@param6");
|
|
|
|
Date date = dateP.getValue();
|
|
|
|
logger.info("@param6 date is " + date);
|
|
|
|
}</pre>
|
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
XML Presentation of Strolch's top level elements of <i>Resources</i>:
|
2016-09-16 11:29:01 +02:00
|
|
|
<pre class="pre-scrollable">
|
2014-09-19 17:18:51 +02:00
|
|
|
<!-- Resource instance -->
|
|
|
|
<Resource Id="MyTestResource" Name="Test Name" Type="TestType">
|
|
|
|
<ParameterBag Id="@bag01" Name="Test Bag" Type="TestBag">
|
|
|
|
<Parameter Id="@param7" Name="StringList Param" Type="StringList" Value="Hello;World" />
|
|
|
|
<Parameter Id="@param6" Name="Date Param" Type="Date" Value="2012-11-30T18:12:05.628+01:00" />
|
|
|
|
<Parameter Id="@param5" Name="String Param" Type="String" Value="Strolch" />
|
|
|
|
</ParameterBag>
|
|
|
|
<ParameterBag Id="@bag02" Name="Test Bag" Type="TestBag">
|
|
|
|
<Parameter Id="@param4" Name="Long Param" Type="Long" Value="4453234566" />
|
|
|
|
<Parameter Id="@param3" Name="Integer Param" Type="Integer" Value="77" />
|
|
|
|
<Parameter Id="@param2" Name="Float Param" Type="Float" Value="44.3" />
|
|
|
|
<Parameter Id="@param1" Name="Boolean Param" Type="Boolean" Value="true" />
|
|
|
|
</ParameterBag>
|
|
|
|
<TimedState Id="@integerState" Name="Integer State" Type="IntegerState">
|
|
|
|
<Value Time="0" Value="1" />
|
|
|
|
<Value Time="1" Value="2" />
|
|
|
|
<Value Time="2" Value="3" />
|
|
|
|
<TimedState>
|
2015-08-28 14:59:43 +02:00
|
|
|
</Resource></pre>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
XML Presentation of Strolch's top level elements of <i>Orders</i>:
|
|
|
|
<pre class="pre-scrollable">
|
2014-09-19 17:18:51 +02:00
|
|
|
<!-- Order instance -->
|
2015-08-28 14:59:43 +02:00
|
|
|
<Order Id="MyTestOrder" Name="Test Name" Type="TestType" Date="2013-11-20T07:42:57.699Z" State="CREATED">
|
2014-09-19 17:18:51 +02:00
|
|
|
<ParameterBag Id="@bag01" Name="Test Bag" Type="TestBag">
|
|
|
|
<Parameter Id="@param7" Name="StringList Param" Type="StringList" Value="Hello;World" />
|
|
|
|
<Parameter Id="@param6" Name="Date Param" Type="Date" Value="2012-11-30T18:12:05.628+01:00" />
|
|
|
|
<Parameter Id="@param5" Name="String Param" Type="String" Value="Strolch" />
|
|
|
|
</ParameterBag>
|
|
|
|
<ParameterBag Id="@bag02" Name="Test Bag" Type="TestBag">
|
|
|
|
<Parameter Id="@param4" Name="Long Param" Type="Long" Value="4453234566" />
|
|
|
|
<Parameter Id="@param3" Name="Integer Param" Type="Integer" Value="77" />
|
|
|
|
<Parameter Id="@param2" Name="Float Param" Type="Float" Value="44.3" />
|
|
|
|
<Parameter Id="@param1" Name="Boolean Param" Type="Boolean" Value="true" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Order></pre>
|
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
XML Presentation of Strolch's top level elements of <i>Activities</i>:
|
|
|
|
<pre class="pre-scrollable">
|
|
|
|
<!-- Activity instance -->
|
|
|
|
<Activity Id="bicycleProduction" Name="Bicycle Production" Type="Series">
|
|
|
|
|
|
|
|
<Activity Id="componentProduction" Name="Production of components" Type="Series">
|
|
|
|
|
|
|
|
<Action Id="consumeGears" Name="Gears"
|
|
|
|
ResourceId="gears" ResourceType="Article" Type="Consume">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT0S" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
|
|
|
|
<Activity Id="frameProduction" Name="Production frame" Type="Series">
|
|
|
|
<Action Id="produce" Name="Production frame"
|
|
|
|
ResourceId="frameProduction" ResourceType="Machine" Type="Use">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT5M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
<Action Id="toStock" Name="Frame ToStock"
|
|
|
|
ResourceId="frame" ResourceType="Article" Type="Produce">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT1M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
</Activity>
|
|
|
|
|
|
|
|
<Activity Id="brakeProduction" Type="Series" Name="Herstellen Bremsen" TimeOrdering="Series">
|
|
|
|
<Action Id="produce" Name="Production saddle"
|
|
|
|
ResourceId="saddleProduction" ResourceType="Machine" Type="Use">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT5M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
<Action Id="toStock" Name="Saddle ToStock"
|
|
|
|
ResourceId="frame" ResourceType="Article" Type="Produce">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT1M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
</Activity>
|
|
|
|
|
|
|
|
</Activity>
|
|
|
|
|
|
|
|
<Action Id="assembly" Name="Bicycle assemble"
|
|
|
|
ResourceId="bicycleAssembly" ResourceType="Assembly" Type="Use">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT5M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
|
|
|
|
<Action Id="toStock" Name="Bicycle to stock"
|
|
|
|
ResourceId="bicycle" ResourceType="Product" Type="Produce">
|
|
|
|
<ParameterBag Id="objectives" Name="Production goals" Type="Objectives">
|
|
|
|
<Parameter Id="quantity" Name="Quantity" Type="Float" Value="1" />
|
|
|
|
<Parameter Id="duration" Name="Duration" Type="Duration" Value="PT1M" />
|
|
|
|
</ParameterBag>
|
|
|
|
</Action>
|
|
|
|
</Activity></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Realms</h2>
|
|
|
|
Strolch realms implement the multi-client capability which is thus baked right into the Strolch runtime. When
|
|
|
|
configuring a Strolch runtime, realms are configured and for each realm the data store mode is set. Each realm
|
|
|
|
has its own persistence configuration and can thus run in one of the 4 modes that the Strolch agent implements:
|
|
|
|
<ul>
|
|
|
|
<li>EMPTY
|
|
|
|
<p>This is a transient data store mode, where no model changes are persisted, but they are only kept in
|
2018-06-25 11:42:26 +02:00
|
|
|
memory. When the Strolch agent is started, this realm stays empty as no data is loaded.</p></li>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li>TRANSIENT
|
|
|
|
<p>This is the same as EMPTY, but with the difference that when the Strolch agent is started, an XML
|
2018-06-25 11:42:26 +02:00
|
|
|
file is parsed and the in memory realm is populated with the elements parsed from that XML file.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
|
|
|
<li>CACHED
|
|
|
|
<p>In this mode, all data is stored in memory, and any changes made are written back to the persistence
|
2018-06-25 11:42:26 +02:00
|
|
|
layer. This allows for fast in-memory quries, but makes sure no data is lost when the agent is
|
|
|
|
restarted.</p></li>
|
2015-08-28 14:59:43 +02:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p>Strolch Realms are also responsible for opening Transactions, as these are bound to the persistence layer
|
2018-06-25 11:42:26 +02:00
|
|
|
configured for this realm. At runtime, a realm is then accessed from the ComponentContainer:</p>
|
2016-09-16 11:29:01 +02:00
|
|
|
<pre class="pre-scrollable">
|
2014-09-19 17:18:51 +02:00
|
|
|
ComponentContainer container = getAgent().getContainer();
|
|
|
|
StrolchRealm realm = container.getRealm(StrolchConstants.DEFAULT_REALM);
|
|
|
|
try(StrolchTransaction tx = realm.openTx()) {
|
|
|
|
Resource resource = tx.getResourceBy("TestType", "MyTestResource");
|
|
|
|
...
|
|
|
|
}</pre>
|
2015-08-28 14:59:43 +02:00
|
|
|
In a Service implementation there is a convenience method, so that this is as simple as calling <i>openTx(String)</i>.
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<h2>Services and Commands</h2>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>In the motivation section, it was discusses that writing business logic is what developing is about and a
|
2018-06-25 11:42:26 +02:00
|
|
|
reason why Strolch is a different approach to the Java EE ecosystem. So this is where Services and Commands
|
|
|
|
come into play, and tries to make writing business logic a first class citizen.</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>Services are to be used once for each use case. Services are not re-used or called by other services.
|
2018-06-25 11:42:26 +02:00
|
|
|
Services open transactions are implement the calling of the re-usable commands. Thus when writing projects
|
|
|
|
using Strolch, the first thing to do after configuring the runtime environment for your situation, Services
|
|
|
|
will be implemented.</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2018-06-25 11:42:26 +02:00
|
|
|
<p>Commands on the other hand are re-usable and should be implemented in such a way, that they encapsulate the
|
|
|
|
use case's different actions. Commands are then passed to a transaction for execution and, when the
|
|
|
|
transaction is committed, will be executed. Commands also implement undoing its operation in the case of
|
|
|
|
exceptions. Strolch transactions handle the life-cycle of a command. A further function of Commands is to
|
|
|
|
lock the relevant Strolch elements before execution.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>A typical Service and Command implementation would look as follows:</p>
|
2016-09-16 11:29:01 +02:00
|
|
|
<pre class="pre-scrollable">
|
2014-09-19 17:18:51 +02:00
|
|
|
public class SetParameterService extends AbstractService<SetParameterArg, ServiceResult> {
|
|
|
|
|
|
|
|
public static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected ServiceResult internalDoService(SetParameterArg arg) {
|
|
|
|
|
|
|
|
// open a new transaction
|
|
|
|
try (StrolchTransaction tx = openTx(arg.realm)) {
|
|
|
|
|
|
|
|
// find parameter to modify
|
|
|
|
Parameter<?> parameter = tx.findElement(arg.locator);
|
|
|
|
|
|
|
|
// instantiate the command
|
|
|
|
SetParameterCommand command = new SetParameterCommand(getContainer(), tx);
|
|
|
|
|
|
|
|
// set the arguments
|
|
|
|
command.setParameter(parameter);
|
|
|
|
command.setName(arg.name);
|
|
|
|
command.setInterpretation(arg.interpretation);
|
|
|
|
command.setUom(arg.uom);
|
|
|
|
command.setHidden(arg.hidden);
|
|
|
|
command.setIndex(arg.index);
|
|
|
|
command.setValueAsString(arg.valueAsString);
|
|
|
|
|
|
|
|
// add the command to the transaction
|
|
|
|
tx.addCommand(command);
|
2015-04-06 16:02:58 +02:00
|
|
|
|
|
|
|
// only now do we say we want to commit so that a rollback works nicely
|
|
|
|
tx.commitOnClose();
|
2014-09-19 17:18:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// return the execution result of the service
|
|
|
|
return ServiceResult.success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The argument class for this service
|
|
|
|
*/
|
|
|
|
public static class SetParameterArg extends ServiceArgument {
|
|
|
|
public static final long serialVersionUID = 1L;
|
|
|
|
public Locator locator;
|
|
|
|
|
|
|
|
public String name;
|
|
|
|
public String interpretation;
|
|
|
|
public String uom;
|
|
|
|
public Boolean hidden;
|
|
|
|
public Integer index;
|
|
|
|
|
|
|
|
public String valueAsString;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected ServiceResult getResultInstance() {
|
|
|
|
return new ServiceResult();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
|
2016-09-16 11:29:01 +02:00
|
|
|
<pre class="pre-scrollable">
|
2014-09-19 17:18:51 +02:00
|
|
|
public class SetParameterCommand extends Command {
|
|
|
|
|
|
|
|
// input fields
|
|
|
|
private Parameter<?> parameter;
|
|
|
|
private String valueAsString;
|
|
|
|
|
|
|
|
// undo fields
|
|
|
|
private String oldValueAsString;
|
|
|
|
|
|
|
|
private StrolchRootElement replacedElement;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param container
|
|
|
|
* @param tx
|
|
|
|
*/
|
|
|
|
public SetParameterCommand(ComponentContainer container, StrolchTransaction tx) {
|
|
|
|
super(container, tx);
|
|
|
|
}
|
|
|
|
|
|
|
|
// setters for input ...
|
|
|
|
// getters for output ...
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void validate() {
|
|
|
|
DBC.PRE.assertNotNull("Parameter may not be null!", this.parameter);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void doCommand() {
|
|
|
|
|
|
|
|
// lock the element to be modified
|
|
|
|
StrolchRootElement rootElement = this.parameter.getRootElement();
|
|
|
|
tx().lock(rootElement);
|
|
|
|
|
|
|
|
// perform changes
|
|
|
|
if (this.valueAsString != null) {
|
|
|
|
this.oldValueAsString = this.parameter.getValueAsString();
|
|
|
|
SetParameterValueVisitor visitor = new SetParameterValueVisitor();
|
|
|
|
visitor.setValue(this.parameter, this.valueAsString);
|
|
|
|
}
|
|
|
|
|
|
|
|
// update root element
|
|
|
|
if (hasChanges()) {
|
|
|
|
replacedElement = new UpdateElementVisitor(tx()).update(rootElement);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean hasChanges() {
|
|
|
|
return this.oldValueAsString != null || this.oldName != null || this.oldInterpretation != null
|
|
|
|
|| this.oldUom != null || this.oldHidden != null || this.oldIndex != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void undo() {
|
|
|
|
|
|
|
|
// undo changes
|
|
|
|
if (this.oldValueAsString != null) {
|
|
|
|
SetParameterValueVisitor visitor = new SetParameterValueVisitor();
|
|
|
|
visitor.setValue(this.parameter, this.oldValueAsString);
|
|
|
|
}
|
|
|
|
|
|
|
|
// update root element
|
|
|
|
if (hasChanges()
|
2016-02-10 18:13:20 +01:00
|
|
|
&& this.replacedElement != null
|
|
|
|
&& this.replacedElement != this.parameter.getRootElement()) {
|
2014-09-19 17:18:51 +02:00
|
|
|
new UpdateElementVisitor(tx()).update(replacedElement);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}</pre>
|
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<h2>Code</h2>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>The Strolch code can be retrieved from GitHub, where the code is hosted. Each commit triggers a continuous
|
2018-06-25 11:42:26 +02:00
|
|
|
integration build, so that we are sure no tests are broken. The CI is viewable at
|
|
|
|
<a href="https://ci.4trees.ch" target="_blank">4trees CI Server</a>.</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>Strolch is divided up into different projects on GitHub so that these projects can be developed, or bugfixed
|
2018-06-25 11:42:26 +02:00
|
|
|
independently and not all parts are required in every context.</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2018-06-25 11:42:26 +02:00
|
|
|
<p><a href="https://github.com/4treesCH/strolch" target="_blank">Strolch on GitHub</a></p>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<h3>Main Strolch components</h3>
|
|
|
|
<ul>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.model">li.strolch.model</a>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>This project implements the Strolch model. This is where you will find the different elements that
|
2018-06-25 11:42:26 +02:00
|
|
|
can store data at runtime e.g. <i>Resources</i>, <i>Orders</i> and <i>Activities</i></p></li>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.agent">li.strolch.agent</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>The agent is the Strolch runtime and is the component which implements the core Agent functionality.
|
2018-06-25 11:42:26 +02:00
|
|
|
That is:</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
<ul>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li>Provide the Agent instance which loads the configuration and is the entry point to the runtime
|
2014-09-19 17:18:51 +02:00
|
|
|
</li>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li>Provide the ComponentContainer instance from which the registered components can be accessed
|
2014-09-19 17:18:51 +02:00
|
|
|
</li>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li>Configure and maintain the realms, which implement the multi-client capability</li>
|
|
|
|
<li>Provide a default ServiceHandler to perform Services at runtime</li>
|
2018-06-25 11:42:26 +02:00
|
|
|
<li>Implements the realms which each can operate in different modes data store modes: CACHED,
|
|
|
|
TRANSIENT
|
2014-09-19 17:18:51 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.service">li.strolch.service</a>
|
2014-09-19 17:18:51 +02:00
|
|
|
|
2015-08-28 14:59:43 +02:00
|
|
|
<p>Implements the basic Services and the re-usable Commands:</p>
|
2014-09-19 17:18:51 +02:00
|
|
|
<ul>
|
2015-08-28 14:59:43 +02:00
|
|
|
<li>CRUD Services and Commands to modify the model</li>
|
|
|
|
<li>Commands to import and export the model to XML</li>
|
|
|
|
<li>Further services and commands...</li>
|
2014-09-19 17:18:51 +02:00
|
|
|
</ul>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>Additional components</h3>
|
|
|
|
<ul>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.persistence.postgresql">li.strolch.persistence.postgresql</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>Implements a PostgreSQL persistence layer so that the Strolch model can be persisted to a PostgreSQL
|
2018-06-25 11:42:26 +02:00
|
|
|
RDBMS when the realm is configured to have a data store mode of CACHED.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.persistence.xml">li.strolch.persistence.xml</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>Implements an XML persistence layer so that the Strolch model can be persisted to XML files when the
|
2018-06-25 11:42:26 +02:00
|
|
|
realm is configured to have a data store mode of CACHED.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.rest">li.strolch.rest</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>Implements a Restful API to communicate with the Strolch runtime from clients and external
|
2018-06-25 11:42:26 +02:00
|
|
|
systems.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>Meta projects</h3>
|
|
|
|
<ul>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.bom">li.strolch.bom</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>This bill of material is a Maven project which, when imported in one's own Strolch project, pulls in
|
2018-06-25 11:42:26 +02:00
|
|
|
all required dependencies needed to set up a minimal working Strolch environment.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
2016-09-22 13:29:14 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/master/li.strolch.testbase">li.strolch.testbase</a>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
<p>Implements a test base so that writing tests for Strolch is easy. It provides a RuntimeMock, which
|
2018-06-25 11:42:26 +02:00
|
|
|
handles setting up and tearing down Strolch runtimes during tests.</p>
|
2015-08-28 14:59:43 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>Example projects</h3>
|
|
|
|
<ul>
|
2018-06-25 11:42:26 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch/tree/develop/strolch_minimal_rest" target="_blank">strolch_minimal_rest</a>
|
2016-07-04 18:23:26 +02:00
|
|
|
|
2018-06-25 11:42:26 +02:00
|
|
|
<p>A minimal project to get started using REST with Strolch.</p>
|
2016-09-16 11:29:01 +02:00
|
|
|
</li>
|
2018-06-25 11:42:26 +02:00
|
|
|
<li><a href="https://github.com/4treesCH/strolch-bookshop" target="_blank">Strolch Bookshop</a>
|
2016-09-16 11:29:01 +02:00
|
|
|
|
2018-06-25 11:42:26 +02:00
|
|
|
<p>An example implentation of services etc. where we show how to use Strolch by implementing a simple
|
|
|
|
book shop.</p>
|
2016-09-16 11:29:01 +02:00
|
|
|
</li>
|
2015-08-28 14:59:43 +02:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h2>Development</h2>
|
|
|
|
|
|
|
|
<p>To start getting involved with Strolch Development, or create your own applications using Strolch, then see
|
2018-06-25 11:42:26 +02:00
|
|
|
the <a href="development.html">development page</a></p>
|
2015-08-28 14:59:43 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- /.content -->
|
|
|
|
|
|
|
|
<div id="footer">
|
|
|
|
<div class="container">
|
|
|
|
<p class="text-muted">© Strolch / <a href="mailto:eitch@eitchnet.ch">Robert von Burg</a> / Hosting by
|
|
|
|
<a href="http://www.eitchnet.ch">eitchnet.ch</a></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- /.container -->
|
|
|
|
|
|
|
|
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
2016-09-23 10:53:37 +02:00
|
|
|
<!-- Include all compiled plugins (below), or include individual xsd as needed -->
|
2015-08-28 14:59:43 +02:00
|
|
|
<script src="js/bootstrap.min.js"></script>
|
|
|
|
|
|
|
|
<!-- Piwik -->
|
|
|
|
<script type="text/javascript">
|
|
|
|
var _paq = _paq || [];
|
|
|
|
_paq.push(['trackPageView']);
|
|
|
|
_paq.push(['enableLinkTracking']);
|
|
|
|
(function () {
|
|
|
|
var u = (("https:" == document.location.protocol) ? "https" : "http") + "://piwik.eitchnet.ch/";
|
|
|
|
_paq.push(['setTrackerUrl', u + 'piwik.php']);
|
|
|
|
_paq.push(['setSiteId', 2]);
|
|
|
|
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
|
|
|
g.type = 'text/javascript';
|
|
|
|
g.defer = true;
|
|
|
|
g.async = true;
|
|
|
|
g.src = u + 'piwik.js';
|
|
|
|
s.parentNode.insertBefore(g, s);
|
|
|
|
})();
|
|
|
|
</script>
|
2018-06-25 11:42:26 +02:00
|
|
|
<noscript><p><img src="http://piwik.eitchnet.ch/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
|
2015-08-28 14:59:43 +02:00
|
|
|
<!-- End Piwik Code -->
|
|
|
|
|
|
|
|
</body>
|
2014-09-19 17:18:51 +02:00
|
|
|
</html>
|