From version 1.1
edited by Pierre Dubois
on 2011/10/15 15:50
To version 2.1
edited by Maurice Gasco
on 2015/10/23 17:50
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.pdubois
1 +XWiki.mgasco
Content
... ... @@ -1,6 +1,6 @@
1 1  = Operations =
2 2  
3 -Operations are ?Functions? that apply on the entity (on one entity or a set of entities).
3 +Operations are "Functions" that apply on the entity (on one entity or a set of entities).
4 4  For example the "Save" operation stores the entity in the database.
5 5  
6 6  Operations can be as simple as the "Save" operation or much more complex like "Decrease inventory level when an item is taken out of the stock".
... ... @@ -20,6 +20,7 @@
20 20  Operations are build of a series of steps. Those steps are executed in the specified order.
21 21  
22 22  Steps can be:
23 +
23 23  * Parent: calls the operation of the parent entity when the entity is a derived entity.
24 24  * Database step: This can be save, search, load, count and delete.
25 25  * Document step: Manipulates the entity in memory: New or Copy
... ... @@ -27,7 +27,6 @@
27 27  * Workflow: triggers a workflow
28 28  * Script: Certainly the most important type. Using javascript you can query, update, delete all entities in the database.
29 29  
30 -
31 31  = Operations and Scripting =
32 32  
33 33  Script steps are used to manipulate entities. Scripts can be as simple as:
... ... @@ -41,7 +41,6 @@
41 41  
42 42  You may call operations in scripts. Operations are methods of the entity.
43 43  
44 -
45 45  {{code language="JavaScript"}}
46 46  // simple operation calls
47 47  var e = myEntity.New();
... ... @@ -49,6 +49,7 @@
49 49  e.Save();
50 50  {{/code}}
51 51  
51 +
52 52  In this example, New and Save are 2 operations.
53 53  
54 54  
... ... @@ -73,8 +73,8 @@
73 73  
74 74  {{code language="JavaScript"}}
75 75  // set referential entity
76 -var paul = rqEmployee.Get(?233455667775444?); // Get by sysId
77 -var e = myEntity.Get(?45566777553434556?);
76 +var paul = rqEmployee.Get("233455667775444"); // Get by sysId
77 +var e = myEntity.Get("45566777553434556");
78 78  e.myRefProp = paul;
79 79  e.Save();
80 80  
... ... @@ -91,4 +91,3 @@
91 91  e.Save();
92 92  {{/code}}
93 93  
94 -
Icon img13.png
Size
... ... @@ -1,1 +1,1 @@
1 -0 bytes
1 +61.5 KB
Content Icon
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 9.11.5 - Documentation