Service Studio 5.1 Help
Use Action References
In Service Studio you can use actions that are exposed by another eSpace or extension, called, in this context, a Producer. Simply add these actions as eSpace reference (Is an element exposed by a Producer eSpace or extension that, when referenced by a Consumer eSpace, is called an eSpace reference in its context. Once an eSpace reference, e.g. an action or entity, is added, you can use it anywhere in the Consumer eSpace but you cannot change its definition.) of your eSpace, called, in this context, a Consumer eSpace.
|
How to Add an Action Reference: |
|
Once actions are added as references, you can use them in your eSpace:
In any action flow (Collection of elements that graphically implements the behavior of an action. You can have assign and control elements, exception handlers or you can invoke other actions. The elements are linked through Connectors.), by dragging the action from the Referenced Actions folder of the Tools tree, into the flow, just like any other action or
In an expression, in a case where the action reference is a User Function. Select it from the Referenced Functions folder of the Expression Editor. See how to Use User Functions.
How action references are executed
The action that you added as a reference is executed in the context of the Consumer eSpace, that is, within the same database transaction. However, the data contents managed by this action are relative to the Producer eSpace, namely Site properties, Timers, Session Variables, Permission Areas, and Entities. There is one exception, though, for TenantId and TenantName site properties, which are always relative to the Consumer eSpace. The execution context is exactly the same whether or not the action is set as a function.
Note that in a Single Sign-On scenario there is only one session and there some relevant differences, namely in the session variables behavior.
Extension action references
execute, exclusively, in the context of the Consumer eSpace.
In the following examples, eSpace1 is the Producer and eSpace2 the Consumer.
You add a reference to the GetBalance action from eSpace1 that uses the Rate site property. The value used by this action is the value that the Rate site property has in eSpace1, whether or not Rate exists in eSpace2.
You add a reference to the GetBalance action from eSpace1 that uses the TenantId site property. The value used by this action is the value that the TenantID site property has in eSpace2.
You add a reference to the LogPayment action from eSpace1 that awakens the ServiceDelivery timer. This timer is executed in eSpace1 and its runtime properties are updated as if it was awakened directly by eSpace1.
You add a reference to the GetTasks action from eSpace1 that uses the Project session variable. The value used by this action is the value that the Project session variable has in eSpace1, whether or not Project exists in eSpace2.
You add a reference to the CreateProjectManagerUser action from eSpace1 that creates a user in the User table of eSpace1 and uses GrantProjectManagerPermission, afterwards. This permission action grants the newly created user access to the ProjectManager permission area of eSpace1, whether or not the ProjectManager permission area exists in eSpace2.
You add a reference to GrantUserProjectManagerPermission, which has an input parameter: UserId and uses GrantProjectManagerPermission action. When invoked as, for example, GrantUserProjectManagerPermission(704) the action grants user 704 of eSpace2 access to the ProjectManager permission area of eSpace1, whether or not the ProjectManager permission area exists in eSpace2.
You add a reference to the Customer entity from eSpace1 and this entity is single tenant. When you invoke CreateCustomer in eSpace2, you are inserting a new row in the corresponding table stored in the eSpace1 repository. Since the entity is single-tenant, any Consumer eSpace can manage the data inserted by eSpace1.
You add a reference to the Customer entity from eSpace1 and this entity is multi-tenant. When you invoke CreateCustomer in eSpace2, you are inserting a new row in the corresponding table stored in the eSpace1 repository. However, only eSpace1 can manage its own data. Any other Consumer eSpace won't be able to manage the data inserted by eSpace1.
See Also
eSpace References | Add/Remove eSpace References | Expose an Action | About Platform Server Session