diff --git a/li.strolch.website/www.strolch.li/documentation-do-and-dont.html b/li.strolch.website/www.strolch.li/documentation-do-and-dont.html index ae85d83e9..2e3b9c90c 100644 --- a/li.strolch.website/www.strolch.li/documentation-do-and-dont.html +++ b/li.strolch.website/www.strolch.li/documentation-do-and-dont.html @@ -3,7 +3,7 @@ - + @@ -53,20 +53,27 @@

Dos and Don'ts

@@ -106,7 +113,7 @@ s.parentNode.insertBefore(g, s); })(); - + diff --git a/li.strolch.website/www.strolch.li/tutorial-crud-book.html b/li.strolch.website/www.strolch.li/tutorial-crud-book.html new file mode 100644 index 000000000..c3e69cc07 --- /dev/null +++ b/li.strolch.website/www.strolch.li/tutorial-crud-book.html @@ -0,0 +1,102 @@ + + + + + + + + + + + + Strolch: Tutorial CRUD Book + + + + + + + + + + + + +
+ + + +
+ Previous: Model

+ +

Coming soon...

+ + Previous: Model + + + + +
+ + + + +
+ + + + + + + + + + + + + + diff --git a/li.strolch.website/www.strolch.li/tutorial-model.html b/li.strolch.website/www.strolch.li/tutorial-model.html index d8a134c1c..b00074929 100644 --- a/li.strolch.website/www.strolch.li/tutorial-model.html +++ b/li.strolch.website/www.strolch.li/tutorial-model.html @@ -51,16 +51,19 @@
- Previous: ConfigurationNext: + Previous: + ConfigurationNext: CRUD + Books

-

Looking back at our functionality, we can list the following entities that need to be modelled:

+

Looking back at our functionality, we can list the following entities that need to be modelled (We'll go into + detail further down):

@@ -70,85 +73,162 @@ Book
 <Resource Id="Book" Name="Book Template" Type="Template">
-<ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
-  <Parameter Id="description" Name="Description" Type="String" Value="" />
-  <Parameter Id="quantity" Name="Quantity in Stock" Type="Integer" Value="0" />
-</ParameterBag>
-</Resource>
-
- - UserCart -
-<Resource Id="UserCart" Name="UserCart Template" Type="Template">
-<ParameterBag Id="books" Name="Books" Type="Book">
-  <!-- Parameter Id="bookId" Name="Book reference" Type="Float" Value="0" / -->
-</ParameterBag>
-<ParameterBag Id="relations" Name="Relations" Type="Parameters">
-  <Parameter Id="account" Name="Account" Type="String" Interpretation="Resource-Ref" Uom="Account" Value="" />
-</ParameterBag>
+  <ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
+    <Parameter Id="description" Name="Description" Type="String" Value="" />
+    <Parameter Id="quantity" Name="Quantity in Stock" Type="Integer" Value="0" />
+  </ParameterBag>
 </Resource>
 
Account
 <Resource Id="Account" Name="Account Template" Type="Template">
-<ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
-  <Parameter Id="user" Name="User" Type="String" Value="" />
-  <Parameter Id="firstName" Name="First Name" Type="String" Value="" />
-  <Parameter Id="lastName" Name="Last Name" Type="String" Value="" />
-  <Parameter Id="email" Name="E-Mail" Type="String" Value="" />
-</ParameterBag>
-<ParameterBag Name="Address" Id="address" Type="Address">
-  <Parameter Id="phone" Name="Telephone Number" Type="String" Value="" />
-  <Parameter Id="street" Name="Street" Type="String" Value="" />
-  <Parameter Id="city" Name="City" Type="String" Value="" />
-  <Parameter Id="zip" Name="Postal Code" Type="String" Value="" />
-  <Parameter Id="country" Name="Country" Type="String" Value="" />
-</ParameterBag>
+  <ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
+    <Parameter Id="user" Name="User" Type="String" Value="" />
+    <Parameter Id="firstName" Name="First Name" Type="String" Value="" />
+    <Parameter Id="lastName" Name="Last Name" Type="String" Value="" />
+    <Parameter Id="email" Name="E-Mail" Type="String" Value="" />
+  </ParameterBag>
+  <ParameterBag Name="Address" Id="address" Type="Address">
+    <Parameter Id="phone" Name="Telephone Number" Type="String" Value="" />
+    <Parameter Id="street" Name="Street" Type="String" Value="" />
+    <Parameter Id="city" Name="City" Type="String" Value="" />
+    <Parameter Id="zip" Name="Postal Code" Type="String" Value="" />
+    <Parameter Id="country" Name="Country" Type="String" Value="" />
+  </ParameterBag>
 </Resource>
 
- Order + UserCart
-<Order Id="Order" Name="Order Template" Type="Template" State="Created">
-<ParameterBag Id="books" Name="Books" Type="Book">
-  <!-- Parameter Id="bookId" Name="Book reference" Type="Float" Value="0" / -->
-</ParameterBag>
-<ParameterBag Id="relations" Name="Relations" Type="Parameters">
-  <Parameter Id="account" Name="Account" Type="String" Interpretation="Resource-Ref" Uom="Account" Value="" />
-</ParameterBag>
+<Resource Id="UserCart" Name="UserCart Template" Type="Template">
+  <ParameterBag Id="books" Name="Books" Type="Book">
+    <!-- Parameter Id="bookId" Name="Book reference" Type="Float" Value="0" / -->
+  </ParameterBag>
+  <ParameterBag Id="relations" Name="Relations" Type="Parameters">
+    <Parameter Id="account" Name="Account" Type="String" Interpretation="Resource-Ref" Uom="Account" Value="" />
+  </ParameterBag>
+</Resource>
+
+ + PurchaseOrder +
+<Order Id="PurchaseOrder" Name="PurchaseOrder Template" Type="Template" State="Created">
+  <ParameterBag Id="books" Name="Books" Type="Book">
+    <!-- Parameter Id="bookId" Name="Book reference" Type="Float" Value="0" / -->
+  </ParameterBag>
+  <ParameterBag Id="relations" Name="Relations" Type="Parameters">
+    <Parameter Id="account" Name="Account" Type="String" Interpretation="Resource-Ref" Uom="Account" Value="" />
+  </ParameterBag>
 </Order>
 
FromStock
 <Activity Id="FromStock" Name="From Stock Template" Type="FromStock" TimeOrdering="Series">
-<ParameterBag Name="objectives" Id="Objectives" Type="Objectives">
-  <Parameter Name="Duration" Id="duration" Value="PT1MS" Type="Duration" />
-</ParameterBag>
-
-<Action Id="Validate" Name="Validation of order" Type="Use" ResourceType="Validation" ResourceId="validation" />
-
-<!-- for each book we do a consume, i.e. reduce the stock quantity -->
-<Action Id="Consume" Name="Consume Template for book" Type="Template">
-  <ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
-    <Parameter Id="quantity" Name="Quantity" Type="Float" Value="0" />
+  <ParameterBag Name="objectives" Id="Objectives" Type="Objectives">
+    <Parameter Name="Duration" Id="duration" Value="PT1MS" Type="Duration" />
   </ParameterBag>
-</Action>
 
-<Action Id="Package" Name="Packaging of Order" Type="Use" ResourceType="Packaging" ResourceId="packaging" />
-<Action Id="Send" Name="Sending of package" Type="Use" ResourceType="Sending" ResourceId="sending" />
+  <Action Id="validate" Name="Validation of order" Type="Use" ResourceType="Validation" ResourceId="validation" />
+
+  <!-- for each book we do a consume, i.e. reduce the stock quantity -->
+  <Action Id="Consume" Name="Consume Template for book" Type="Template">
+    <ParameterBag Id="parameters" Name="Parameters" Type="Parameters">
+      <Parameter Id="quantity" Name="Quantity" Type="Float" Value="0" />
+    </ParameterBag>
+  </Action>
+
+  <Action Id="package" Name="Packaging of PurchaseOrder" Type="Use" ResourceType="Packaging" ResourceId="packaging" />
+  <Action Id="send" Name="Sending of package" Type="Use" ResourceType="Sending" ResourceId="sending" />
 
 </Activity>
 

Let's explain a few things:

- Previous: ConfigurationNext: +

Since we are referencing resources from actions in the activity, we need to add these as well, but not as + templates. They can be added to the defaultModel.xml file:

+
+<Resource Id="validation" Name="Validation Resource" Type="Validation">
+  <Policies>
+    <Policy Type="ExecutionPolicy" Value="key:ValidationExecution" />
+    <Policy Type="ConfirmationPolicy" Value="key:DefaultConfirmation" />
+  </Policies>
+</Resource>
+
+<Resource Id="packaging" Name="Packaging Resource" Type="Packaging">
+  <Policies>
+    <Policy Type="ExecutionPolicy" Value="key:PackagingExecution" />
+    <Policy Type="ConfirmationPolicy" Value="key:DefaultConfirmation" />
+  </Policies>
+</Resource>
+
+<Resource Id="sending" Name="Sending Resource" Type="Sending">
+  <Policies>
+    <Policy Type="ExecutionPolicy" Value="key:SendingExecution" />
+    <Policy Type="ConfirmationPolicy" Value="key:DefaultConfirmation" />
+  </Policies>
+</Resource>
+
+ +

What should now be noted by these three new Resources is that they have Policy definitions:

+ +

Currently these resources reference policies which don't exist. We will resolve this issue later, when we + implement the execution of the activity.

+ +

This concludes the model definition. In the next step we'll start creating services and commands for our + model.

+ + Previous: + ConfigurationNext: CRUD + Books diff --git a/li.strolch.website/www.strolch.li/tutorial.html b/li.strolch.website/www.strolch.li/tutorial.html index 273c514a1..03703b94f 100644 --- a/li.strolch.website/www.strolch.li/tutorial.html +++ b/li.strolch.website/www.strolch.li/tutorial.html @@ -68,13 +68,16 @@
  • Notify the user when the order is sent
  • -

    Navigation:

    - +

    Navigation:

    + - Next: Configuration +

    The code to the book can be downloaded from GitHub + and will be updated as this tutorial is updated.

    + + Next: Configuration