Serverside actions
No edit summary
No edit summary
Line 1: Line 1:
Server side actions are used when you want to delegate the work to the server.
ServerSide actions are used when you want to delegate the work to the server.


Reasons for delegating to server might be that you want a single performer - the server. This is the case when assigning numbers that must be unique for example.
Reasons for delegating to the server might be that you want a single performer - the server. This is the case when assigning numbers that must be unique, for example.
[[File:2017-02-06 12h39 29.png|thumb]]
[[File:2017-02-06 12h39 29.png|thumb]]
On viewModel Root class choose action "Edit criterias for server side execute".
On the ViewModel Root class, choose the action "Edit criterias for server side execute".


Then "Make available for Server side execute"
Then "Make available for Server side execute".


Now you can set:
Now you can set:
Line 11: Line 11:
Interval == how often is this checked by the server  
Interval == how often is this checked by the server  


Serialized Blocking == when true the job should be small and quick - it is done within the main loop of server actions. If the job is long running/slow it is better to leave as FALSE so that server responds to admin events faster (evolve, check checksum etc)
Serialized Blocking == when true, the job should be small and quick - it is done within the main loop of server actions. If the job is long-running/slow it is better to leave it as FALSE so that the server responds to admin events faster (evolve, check checksum, etc)


Max Answers == The PS Ocl expression will return this many at most - -1 is unlimited
Max Answers == The PS Ocl expression will return this many at most - -1 is unlimited.


Pre EAL == Action language that will be executed prior to PS-OCL. One example of usage is:
Pre EAL == Action language that will be executed before PS-OCL. One example of usage is:
  -- You do not need anthing here but a good example is if you want to limit on a Time:
  -- You do not need anthing here but a good example is if you want to limit on a Time:
  vYesterday:=DateTime.Today.AddDays(-1)  -- vYesterday must be a ViewModel variable
  vYesterday:=DateTime.Today.AddDays(-1)  -- vYesterday must be a ViewModel variable
PS Ocl == the expression the server will run every "Interval"-second, just after the Pre EAL has executed. The result from the expression should be a list of CLASS of the same CLASS that your viewModel root has. For each item in result list the ViewModel will be created. Its actions will be executed in order. Any changed state will be automatically saved to database.
PS OCL == the expression the server will run every "Interval"-second, just after the Pre EAL has executed. The result from the expression should be a list of CLASS of the same CLASS that your ViewModel root has. For each item in the result, a list of the ViewModel will be created. Its actions will be executed in order. Any changed state will be automatically saved to the database.


Example:
Example:
[[File:2017-02-06 12h58 38.png|thumb|860x860px]]
[[File:2017-02-06 12h58 38.png|thumb|860x860px]]
[[Category:MDriven Server]]
[[Category:MDriven Server]]

Revision as of 07:37, 8 February 2023

ServerSide actions are used when you want to delegate the work to the server.

Reasons for delegating to the server might be that you want a single performer - the server. This is the case when assigning numbers that must be unique, for example.

2017-02-06 12h39 29.png

On the ViewModel Root class, choose the action "Edit criterias for server side execute".

Then "Make available for Server side execute".

Now you can set:

Interval == how often is this checked by the server

Serialized Blocking == when true, the job should be small and quick - it is done within the main loop of server actions. If the job is long-running/slow it is better to leave it as FALSE so that the server responds to admin events faster (evolve, check checksum, etc)

Max Answers == The PS Ocl expression will return this many at most - -1 is unlimited.

Pre EAL == Action language that will be executed before PS-OCL. One example of usage is:

-- You do not need anthing here but a good example is if you want to limit on a Time:
vYesterday:=DateTime.Today.AddDays(-1)  -- vYesterday must be a ViewModel variable

PS OCL == the expression the server will run every "Interval"-second, just after the Pre EAL has executed. The result from the expression should be a list of CLASS of the same CLASS that your ViewModel root has. For each item in the result, a list of the ViewModel will be created. Its actions will be executed in order. Any changed state will be automatically saved to the database.

Example:

2017-02-06 12h58 38.png
This page was edited 18 days ago on 04/27/2024. What links here