ACTION WEB SERVICES

ACTION WEB SERVICES

The ACTIONs mechanism

ACTIONs are a way of asking the system a list of suggested actions that could be done for a specific object.

For example, if we are editing a PROGRAM, we could ask the system what can we do on that PROGRAM. Then the system would return a list of actions like “Create a Workplan”, “Publish the Program”, etc.

Action Web Services are a group of API functions that can be used to obtain list of actions and execute them. There exists a different function depending on the target object:

The ACTION Context

Sometimes it is desirable to provide additional information to obtain a more specific list of actions. For example, instead of invoking action_list_case () and get all the available actions for a CASE, we would prefer to obtain only the specific list of actions for a particular ADMISSION of that CASE.

To solve this problem, action_list functions admit a parameter for specifying a context (see ACTION CONTEXT (JSON) structure)

Navigation through ACTION trees

The list of actions for an object may be large, or it may include different groups of actions. For this reason, the system organizes ACTIONs as nodes of an ACTION tree. Therefore, an ACTION can be considered as a node of an ACTION tree, and we can find three classes of nodes (see 

the action_list() API functions offer a way of navigating through a categorized tree until the desired ACTION is found (think of it as navigating through folders in a file system until the desired file is found).

When a list of ACTIONs is requested using any of the action_list() functions, the API can return three different classes of nodes (see ACTION OBJECT):

  • ACTION: this is a final object. It is an action that can be executed by invoking action_exec ()
  • PATH: This is an intermediate object. Represents a branch in the ACTION tree (like a folder in a file system). To view the contents of this PATH we must call again the corresponding action_list function passing the path value as parameter
  • INPUT: The API needs some information from the user to generate the list of ACTIONs. This is similar to a PATH, but it is not possible to navigate farther unless we provide the requested information. To continue navigating we must call again the corresponding action_list function passing the value requested

Action functions