Commit Graph

138 Commits

Author SHA1 Message Date
Robert von Burg 5f1f4af7b0 [Major] GenericReport now supports filter policies
The first two are:
- GreaterThan for FloatParameters
- Equals for strings
2017-05-03 15:32:20 +02:00
Robert von Burg f331babd3d [Minor] Small fixes 2017-04-25 19:47:15 +02:00
Robert von Burg d1a392f025 [Major] Changed the behaviour of the EventBasedExecutionHandler
Now execution is always performed asynchronously for each Action and an
Activity should be added to the ExecutionHandler by calling
.addForExecution(), so that it is executed later even if an action
couldn't be executed to it being reserved (for instance).
2017-04-22 19:25:27 +02:00
Robert von Burg ffe7c2ae0f [New] Added GenericReport.hasDateRangeSelector() 2017-04-13 14:41:07 +02:00
Robert von Burg c835ef2735 [Minor] Cleaned up use of new FileInputStream 2017-04-11 11:04:46 +02:00
Reto Breitenmoser d469a035fb added commitOnClose statement and unit test 2017-03-28 22:19:55 +02:00
Reto Breitenmoser 23b12631d0 if the resource doesn't exist add otherwise update 2017-03-28 21:51:26 +02:00
Robert von Burg 537c6ea8d0 [Fix] Properly initialize GenericReport 2017-03-27 14:39:03 +02:00
Robert von Burg a982097d4f [Minor] added GenericReport.getOrderedColumnKeys() 2017-03-27 14:04:39 +02:00
Robert von Burg 3935a425e0 [Minor] Simplified GenericReport implementation 2017-03-27 11:51:53 +02:00
Robert von Burg bc52cdabda [Minor] Also allow to pass a Set for filter 2017-03-24 11:25:56 +01:00
Robert von Burg 22892671a5 [New] Added searching of column parameter in GenericReport
If a column definition exists as follows:
  <Parameter Id="minQuantity" Name="Min Quantity" Type="String"
Interpretation="Resource-Ref" Uom="Storage"
Value="$search:parent:Bags/parameters/minQuantity" />
  
Then a search is done by looking on this element, and all "parent"
elements where the parent relation is defined by the parameter with the
id "parent". The first instance of the Parameter "minQuantity" is used
as the value for the report.
2017-03-22 14:55:54 +01:00
Robert von Burg 1c4decd578 [Fix] Don't add a null value to the rows in GenericReport 2017-03-22 13:55:31 +01:00
Robert von Burg 9c45bf2ec3 [New] GenericReport: DateRange filter, incl. $id, $type, $date, $state 2017-03-21 15:34:10 +01:00
Robert von Burg 332463f8a9 [New] Added GenericReport.generateFilterCriteria()
This allows the UI to show filter facets based on the actual data
2017-03-21 08:23:29 +01:00
Robert von Burg b0e57d6425 [New] Added filtering to GenericReport 2017-03-21 07:51:13 +01:00
Robert von Burg 30ad0fcaa8 [New] Added new generic report creator
Create a Report as follows:

<Resource Id="stockReport" Name="Stock Report" Type="Report">

  <ParameterBag Id="parameters" Name="parameters" Type="Parameters">
    <Parameter Id="objectType" Name="Object Type" Type="String"
Interpretation="Resource-Ref" Uom="Slot" Value="Slot" />
  </ParameterBag>

  <ParameterBag Id="columns" Name="Display Columns" Type="Display">
    <Parameter Id="location" Name="Location" Type="String"
Interpretation="Resource-Ref" Uom="Location" Value="$name" />
    <Parameter Id="storage" Name="Storage" Type="String"
Interpretation="Resource-Ref" Uom="Storage" Value="$name" />
    <Parameter Id="section" Name="Section" Type="String"
Interpretation="Resource-Ref" Uom="Section" Value="$name" />
    <Parameter Id="slot" Name="Slot" Type="String"
Interpretation="Resource-Ref" Uom="Slot" Value="$name" />
    <Parameter Id="product" Name="Product" Type="String"
Interpretation="Resource-Ref" Uom="Product" Value="$name" />
    <Parameter Id="quantity" Name="Quantity" Type="String"
Interpretation="Resource-Ref" Uom="Slot"
Value="Bags/parameters/quantity" />
    <Parameter Id="maxQuantity" Name="Quantity" Type="String"
Interpretation="Resource-Ref" Uom="Slot"
Value="Bags/parameters/maxQuantity" />
  </ParameterBag>

  <ParameterBag Id="joins" Name="Joins" Type="Joins">
    <Parameter Id="Product" Name="Product" Type="String"
Interpretation="Resource-Ref" Uom="Product" Value="Slot" />
    <Parameter Id="Section" Name="Section" Type="String"
Interpretation="Resource-Ref" Uom="Section" Value="Slot" />
    <Parameter Id="Storage" Name="Storage" Type="String"
Interpretation="Resource-Ref" Uom="Storage" Value="Section" />
    <Parameter Id="Location" Name="Location" Type="String"
Interpretation="Resource-Ref" Uom="Location" Value="Storage" />
  </ParameterBag>

</Resource>

This creates a report for objects of type Slot, where a Join is done on
multiple objects:
  Slot
    -> Product
    -> Section
         -> Storage
               -> Location

Thus the columns can then be fetched from different joing objects. The
joing is done by searching for a Parameter on the joined object on the
ParameterBag "relations". See the example XML on how this is done.

Or ask eitch@eitchnet.ch to write a proper documentation =))

Filtering is missing, and will be added later
2017-03-20 19:27:59 +01:00
Robert von Burg e0149cc4b0 [Major] Removed many visitors and implemented proper visitor pattern... 2017-03-02 16:52:50 +01:00
Robert von Burg 89739717f2 [Major] Refactored LockHandler to use Locator
This is required because in certain instances it is important to lock
the object before retrieving it, otherwise if, for instance in
execution, we would need to fetch, lock and re-fetch to be sure we have
the latest object.

In moste of the Update*Commands this is not important as we perform a
list commit wins, where the client wants their version to be persisted.
Later a optimistic locking can be performed in that the given version
must be the latest, otherwise an exception would be thrown
2017-02-22 12:14:23 +01:00
Robert von Burg 111a75c034 [Fix] Lock activities during execution! 2017-02-21 18:48:24 +01:00
Robert von Burg 5c8ccabd7f [New] Added new ReservationExection to reserve resources 2017-02-20 17:32:44 +01:00
Robert von Burg 99989de8b4 [New] Added StringMapResult to use as a ServiceResult 2017-02-20 09:17:18 +01:00
Robert von Burg 757300e955 [Fix] Don't delete other user's files! 2017-02-17 22:52:49 +01:00
Robert von Burg 9041bf9fb5 [New] Added new StringMapArgument for StrolchServices 2017-02-16 11:15:08 +01:00
Robert von Burg a67e18af40 [New] Added RuntimeMock.doServiceAssertResult() 2017-02-16 11:14:41 +01:00
Robert von Burg 061436e7ee [Project] Refactoring tests 2017-01-31 14:20:47 +01:00
Robert von Burg de1d569efd [Minor] Moved PrivilegeAddUserService to command, added tests 2017-01-31 14:20:14 +01:00
Robert von Burg 5cdffcc450 [New] Implemented StrolchTransaction.setSuppressAuditsForAudits() 2017-01-31 11:24:27 +01:00
Robert von Burg 02a8f9d3ef [Minor] Added JavaDoc to execution policies 2017-01-23 16:44:14 +01:00
Robert von Burg 13a7c83d96 [New] Added new SimpleExecution and DurationExecution extends it 2017-01-20 10:23:47 +01:00
Robert von Burg 744c7614d3 Merge branch 'release/1.4.0' into develop 2016-11-03 13:35:58 +01:00
Robert von Burg e7cf9bad6d [Fix] Fixed undo logic for general commands
Should a command be undone, then some commands performed an undo,
although they didn't perform their work, this led to an inconsistent
data model. I.e. AddResourceCommand would fail because the resource
already existed and an undo would lead to the existing object being
removed
2016-11-03 13:35:29 +01:00
Robert von Burg df4d716c35 Merge branch 'release/1.4.0' into develop 2016-11-03 12:14:31 +01:00
Robert von Burg da41e2aeb9 [Project] Remove xmlpers as dependency from service project 2016-11-03 12:10:43 +01:00
Robert von Burg 905db8c297 [Project] Set new version 1.5.0-SNAPSHOT 2016-11-03 12:07:38 +01:00
Robert von Burg bff0215510 [Major] Refactored the DurationExecutionTimer to not be singleton
Once again it is clear how bad singletons are. One test killed the
timer, thus all other tests failed. Now the DelayedExecutionTimer is
retrieved from the ExecutionHandler and is called DelayedExecutionTimer
with a default implementation of SimpleDurationExecutionTimer
instantiated by the EventBasedExecutionHandler
2016-10-11 14:59:52 +02:00
Robert von Burg 3be7f9e905 [Fix] Fix timing in execution tests for CI 2016-10-06 21:16:00 +02:00
Robert von Burg 001717d987 [Fix] Fixed ToStock Execution due to changes in Strolch 1.4.x 2016-10-06 20:46:15 +02:00
Robert von Burg b775c00f4d [Major] Implemented ExecutionDuration and fixed deep execution
Using the DurationExecution:

<Activity Id="produceBicycle" Name="Activity" Type="ToStock" 
        TimeOrdering="Series">
  <ParameterBag Name="objectives" Id="Objectives" Type="Objectives">
    <Parameter Name="Duration" Id="duration" Value="PT0.01S" 
          Type="Duration" />
  </ParameterBag>
  <Action Id="produce" Name="Produce" ResourceId="bicycle" 
          ResourceType="Product" Type="Produce" />
</Activity>

IActivityElement now has a new method .findParameter() to search up the
activity hierarchy to find the element
2016-10-06 20:38:06 +02:00
Robert von Burg 811b71f543 [Major] Implemented EventBasedExecutionHandler
Now all Actions are executed, as long as Execution is done through the
ExecutionHandler
2016-09-30 16:35:16 +02:00
Robert von Burg 48caa84903 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 15:54:30 +02:00
Robert von Burg dd227c65d0 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 12:26:27 +02:00
Robert von Burg aab5f0b22f [Major] Moved planning services to li.strolch.planning 2016-09-24 19:07:42 +02:00
Robert von Burg 65c02d2cc0 [Major] Implemented first version of Activity execution 2016-09-23 14:20:16 +02:00
Robert von Burg b4bc62d11c [Major] Implemented first version of Activity execution 2016-09-23 14:03:42 +02:00
Robert von Burg d86e23b58f [Fix] Fixed locator finding for Activity and Action 2016-09-23 13:29:02 +02:00
Robert von Burg d413794213 [Major] Added Activity.TimeOrdering and updated Model XSD 2016-09-23 10:53:37 +02:00
Robert von Burg 02e0110fc6 [Minor] Refactoring packages of tests 2016-09-22 21:59:40 +02:00
Robert von Burg 5cbbfebf06 [Major] Services now consider Arg realm or user realm 2016-09-22 21:52:36 +02:00
Robert von Burg b7b9d63e79 [Major] Refactored services to use generic Arguments were applicable 2016-09-22 21:06:57 +02:00