Alemba API Programmers' Cookbook
This section of the documentation contains information on how to use the API to create well-formed Alemba® objects, i.e. objects in the ASM database that contain the data and relationships necessary for those objects to behave in a manner that is compatible with objects created by the suite of ASM applications.
The role of the Alemba® rules engine
The business logic that determines how objects behave after creation is contained in the Alemba® rules engine (also known as Infra Rules). Some examples of what it does are:
The initial routing of calls
The creation and progression of tasks for new requests
The application of SLAs and other agreements
Creating history entries
This engine is invoked when objects are created via the API, so the rules therein will be automatically applied, just as they are for objects created via ASM interfaces. This simplifies using the API in a large number of cases – all the API user has to do is to set the values that will trigger those rules and the engine will take care of the rest. The key properties and parameters that impact behaviour are covered in the recipes.
Processes that don’t use the rules engine
There are some processes which must operate across multiple transactions and require user interaction. In these cases, the API user has more work to do – to create things in the right order, and to link the objects correctly. One such example is the creation of Service Orders - details for how to do this are given in Creating a Service Order.
Implications of the difference between a WCF and RESTful API
In the Classic WCF (Windows Communication Foundation) API, some transactions include parameters that not only impact the main subject of the transaction, but also create, link or update other related objects. This kind of hybrid action is not appropriate in an API whose nature is to enable state transfers, rather than to implement compound rules-driven behaviour. The same ends can be achieved in other ways, and these are described in the cookbook.
Cooking principles - Lock before you update
The following example refers to Call, but applies to all lockable items, such as Assets and Tickets (Calls, Requests and Tasks) and their sub-types.
Before performing an update in ASM Core, you need to Take Action in Core, which as well as assigning the call to yourself. The Core user interface also locks the call, until you close the call screen. You need to follow equivalent principles when using the API to ensure consistent operation with the Core application
Note that in the API, the actions available to you will depend on the state of the record, and the subset of actions that you should attempt are subject to your privileges.
When you Get a record:
Other actions may work, even if they are not listed for the current state of the entity. But there is a higher likelihood that they will fail.
When you Lock a record:
Now you can perform the desired action.
Some actions – e.g. Defer, Forward, Close – automatically perform an Unlock too. If you need to perform further actions after this, you may need to lock the object again. The response to any action, also includes a list of suggested actions applicable to the current state.
Locked records will eventually be unlocked when the current session expires, just as in ASM Core. This follows the same pattern as implemented across the ASM product set, and should not cause unexpected behavior in those products.