In this tutorial we create a simple Supply Chain Track and Trace solution based on Sales Orders and Deliveries.
We learn how to
In just 5 minutes you can see how your solution posts Sales Orders, receives delivered quantities and sends Alerts in case of a delay.
We will do the following:
Let’s start!
Log in to a SYGR Reporter Server (or Bunch Server if you use a standalone system)
and select Master Data.
Select Entity Models.
Select Create New
and give it a name. All other fields are optional.
Click on master data structure.
It opens the Attribute Editor. The Attribute Editor is a very powerful tool to create flexible data structures in SYGR.
It starts at the ROOT node, every other node comes under it, so click on node below.
Create a field called material and click the OK button.
You can see on the right side, that the material field is created.
Now create a requested quantity field on the same level.
The next field, the received quantity we create under the requested quantity (just to intruduce some hierarchy. Attribute hierarchies can be any depth in SYGR).
We just add two more fields: a requested delivery date and a status field, which has a default value.
We have all the fields we need.
Click on the OK button on the top.
We returned to the main screen.
Click on save.
The Entity Model is saved and in the list of models.
The next step is, to link our model to a Store Type.
Store Types determine, which SYGR servers will process
the transformations and which databases will store the results.
One Entity Model can be linked to exactly one Store Type.
On the list page select new.
Select your Entity Model, a suitable Store Type and save.
Let’s try it!
We did not create an own API, so we use the default SYGR API, which accepts a fix structure JSON or XML input.
The matchkey0 and matchval0 stores our Sales Order number. It will be used later to send transformation messages to it.
This example message is composed and sent by Postman:
(To send RESTful messages to SYGR, a user has to be created in the system with the necessary authorizations.)
Check the result.
On the system main page select Reporting
Then select Entities
The Entity Reporting provides a lot of selection possibilities, now just press the run button at the bottom.
And here it is, our very first Sales Order.
This is the standard SYGR report format, later we will learn how to make customized reports.
Have a look at the details (eye icon on the left).
What happened here?
Our predefined fields in the Master Data (copy) are empty, but the same fields were created in the transactional data.
The reason is, that when one posts a new Entity, only the transactional data part is accepted from the message.
The master data is always copied from the Entity Model (but later can be modified by Transformations).
So we must modify our Model, to have the fields in the Transactional Data part (except for the status field).
Now it is good.
The Master Data (copy) contains only the status, the Transactional Data all other fields, which we sent with the message.
In this picture you can see also how the sales order number is stored as a match key-value pair.
As next step we create two Transformation Models.
One to post delivered quantities. To keep the model simple, we transfer only the quantity, no delivery number or other information.
The second is to check the delivery status and send alert in case of a problem.
Click on Transformation Models.
Create the models the same way as the Entity Model was created.
The model "Deliver sales order" has one field, the delivered quantity.
The model "Check sales order status" has a timestamp field, against which we will check the status.
The Transformation Models must be linked to one or several Entity Models. The Entity Models can belong to the same or to different Store Types, so a Transformation can be sent to different business processes.
We have linked both Transformation Models to our only Entity Model, the My test sales orders.
When a Transformation is sent to an Entity, it does not know in itself, what to do.
We must define Rules to tell it.
Click on Rules in the Master Data Maintenance and then on the Create New icon.
We arrived to the main screen of the Rule maintenance.
This screen requires some explanation.
So we create a Rule to receive delivered quantities. Fill the fields like this:
It is an Internal Rule, linked to our Entity and Transformation model.
It will simply add the new delivered quantity to the already delivered quantity.
To define it, click on the details at the bottom.
In the Rule Details we can define four different things:
We need two variables:
One for the already received quantity and one for the newly delivered quantity.
So click on “new” beside the Variables and create them.
Press the save button when done.
(POFL means the transactional data part of the Entity, BALA is the data part of the Transaction)
![]() |
![]() |
We also need a Rule Step.
The first Step must be labeled as “START”, otherwise the whole Rule will be not executed.
Here we simply add the new delivered quantity to the already delivered, using the Variables defined earlier.
Let us try it!
We again send a message to the default SYGR API with the number of one of our sales order, reporting the delivery of 10 Unicorns.
Opening the Sales Order details in Reporting, we can see, that the received quantity is changed from 0 to 10.
If we send the same message one more time, the received quantity changes to 20.
Now we create another Rule to execute the status check.
The method is the same as before, only we need more variables and also an alert.
Click on the details.
We use some more variables:
We also need an Alert.
Alerts are e-mails sent to predefined Targets, which is a list of recipients.
Create a new Alert, Set the severity to Error, give some text and select an alert target.
Alert targets are defined in the SYGR Regio Server.
The Alert is now available in the Rule details screen:
Now we create two steps.
The first checks that the requested delivery time is over AND still not enough quantity was delivered.
If it’s true, then sends the alert and moves to the STATUS_ERROR step.
The second step sets the sales order status to error.
Send a check request to the same sales order, but with a check date that is later than the requested delivery date.
Remember, we delivered so far only 20 unicorns instead of the ordered 100.
As a result, we receive an e-mail.
From an internal rule only very simple mails can be sent, if you want to include detailed information, it must be created by a Plugin (like an external step in the Rule).
And, as expected, the status of the Sales Order is changed to “error”.
We have arrived to the end of this tutorial.
We have learned how to create Entity and Transformation Models, how to associate Rules to them and send alert.
See you in our next tutorial, where we go into more details of the SYGR Automation System.
If you have questions, please contact us:
contact@sygr.ch
contact@sles-automation.com
+41 79 470 67 84