Nextian enables order processing automation, integration, and orchestration with automated tasks within work order templates and later actual work orders.
Automated tasks execute Salesforce APEX code instead of being assigned to users or queues for manual processing. These tasks can be seamlessly combined with manual tasks within a single work order template — there are no restrictions. For example, a fully automated template can be created to support zero-touch provisioning processes.
Common use cases for automated tasks include:
- Integrating with third-party systems (e.g., provisioning or billing platforms)
- Performing complex or multi-step operations within Salesforce itself
Automated tasks include all the standard fields and behaviors of manual tasks (such as dependencies and scheduling) and also support additional automation-specific attributes, described below.
Call Method
Call Method is a name of an APEX class and its static method (Class.MethodName) called to execute the task. The method takes only one argument — the calling work order task id as a Salesforce Id type (retrieval of other pieces of information such as work order or service ids is up to the implementation).
The Method is an entry point only and can subsequently call other methods. The Class must be deployed on the org and the calling user (see below) must have access to it.
The called class must implement Salesforce callable interface (the callable interface enables dynamic/loosely coupled integrations between Apex classes or triggers).
An example class is shown below:
// Helper class (must be non-static as Callable requires non static classes): public with sharing class BillingHelper implements Callable { // Helper method (this method is static): public static void createBillingOrder(Id workOrderTaskId) { ... your processing here ... } // Callable interface implementation (not static): public Object call(String action, Map<String, Object> args) { // Retrieve calling task id: Id taskId = (Id)args.get('taskId'); if(taskId == null) { throw new CalloutException('Task id missing.'); } else if (action == 'createBillingOrder') { // this value passed from calling automated task (in this case BillingHelper.createBillingOrder) BillingHelper.createBillingOrder(taskId); return null; } else { ... other methods ... } } }
The helper method should return no value (and callable return is always null); however, any exception thrown will be caught and reported to the user interface and logged in the Error Message field of the calling task.
Task configuration to call BillingHelper.createBillingOrder above would look like:
Execution Type
Execution Type determines how Call Method is invoked:
Execution Type | Description |
---|---|
Manual | In this scenario, when a task becomes Ready, it is still assigned to a user or queue.The user has to run the code manually by using Execute action on the task.
The code is executed in the context of the user. |
Future Method | Call Method is automatically invoked when the task becomes Ready via a Salesforce future method. |
Batch Job | Call Method is automatically invoked when the task becomes Ready according the ‘Process Automated Tasks’ job schedule. |
Built-in Helper Methods
Nextian provides an APEX helper class called AutomatedTask providing static methods for work order automation (users can add their own methods for billing systems- or provisioning integrations, additional automation in Salesforce and others):
The following helper methods are available:
Helper Method | Description |
---|---|
AutomatedTask.startService | Start service associated with the current work order (including the add-ons if present). |
AutomatedTask.cancelService | Cancel service associated with the current work order. |
AutomatedTask.updateServiceAddOns | Creates new service add-ons and deactivates canceled ones for the Change Service Add-Ons quote line item type. |