Revenue Management API Developer Reference

ffrr.RevenueScheduleAutomationService

global with sharing class RevenueScheduleAutomationService

Contains methods for Revenue Schedule automation.

Enums

AutomationProcess

Denotes an individual process that can be run by the automation service. The order these are listed here is the same order in which the processes will be run, if selected.

Value Description
DeleteSourceUnavailable The process to delete revenue schedules where the source record is unavailable.
Generate The process to generate revenue schedules from source records.
Recognize The process to recognize revenue schedules.
Summarize The process to summarize revenue recognition transactions.
CreateJournals The process to create FFA journals from revenue recognition transactions.

Methods

runProcesses

global static ffrr.RevenueScheduleAutomationService.AutomationResult runProcesses(ffrr.RevenueScheduleAutomationService.AutomationConfig configuration)

Runs the revenue schedule processes specified by the ffrr.RevenueScheduleAutomationService.AutomationConfig object from the first process to last process. See the RevenueScheduleAutomationService.AutomationProcess enum for the available values. The order in which these processes happens is as follows:
1) DeleteSourceUnavailable
2) Generate
3) Recognize
4) Summarize
5) CreateJournals
When the configuration object is supplied with a firstProcess and lastProcess every step in between is also run.
The automation service uses the Foundations async framework to chain the individual processes together so you can check the Process Runs tab to check on the status of the run. Note only the currently running process is visible. Once that finishes the next process will be run and become visible.
The configuration object also controls if the summarization process should be run. See the summarizeTransactions option. If not specified defaults to true. If the first to last process covers Summarize and the summarizeTransactions boolean is set to true it will summarize the revenue recognition transactions. If the CreateJournals is also included the automation process will create journals using transaction summaries rather than revenue recognition transaction lines.
Note CreateJournals requires the RRT to Journal Integrations to be enabled and working for either revenue transaction summaries or revenue recognition transaction lines depending on whether the summarizeTransactions flag is set to true.
Consult the Help for which records are picked up by each automation process.

Input Parameters

Name Type Description
configuration ffrr.RevenueScheduleAutomationService.AutomationConfig The configuration object for the automation process.

Exceptions Thrown

Value Description
ffrr.Exceptions.InvalidArgumentException If the first process is after the last process or nothing is passed to the configuration object for either parameter an exception will be thrown. If the CreateJournals process is selected and the RRT to Journal Integration is not setup and working the system will throw an exception. If both the first and last process are Summarize and summarizeTransactions is false the system throws an exception.
ffrr.Exceptions.IllegalStateException If a Revenue Schedule process ie Synchronize, Delete, Generate or Recognize is currently running then the system will throw an exception.

Return Value

Returns a ffrr.RS_AutomationService.AutomationResult object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

// example 1
// In this example the automation service has been asked to run from Generate to CreateJournals including summarizing the transactions.
// The processes will be chained from one to the other including the steps in between eg. Generate, Recognize, Summarize, CreateJournals

ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate;
ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals;

ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess);

// call the run processes method to chain the configured processes together and set the first one running.
ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config);

// example 2
// In this example the automation service is being used to run only a single process Generate.

ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate;
ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate;

ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess);

// call the run processes method to chain the configured processes together and set the first one running.
ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config);

// example 3
// In this example only the Recognize and CreateJournals method will be called (creating journals from revenue recognition lines)

ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Recognize;
ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals;

Boolean summarizeTransactions = false;

ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess, summarizeTransactions);

// call the run processes method to chain the configured processes together and set the first one running.
ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config);

ffrr.RevenueScheduleAutomationService.AutomationConfig

global with sharing class AutomationConfig

Class used to pass configuration to automation API call.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

//Configure which processes should be run, starting from firstProcess, following the order of processes in the AutomationProcess enum until lastProcess is reached (inclusive)
//In this example, Generate, Recognize and Summarize will be run in that order.
ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate;
ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Summarize;

//Set if transactions should be summarized when Summarize is included in the processes to run.
//Additionally, if the CreateJournals process is included in the processes to run, sets if journals should be created from transaction summaries (if true) or from transaction lines (if false).
Boolean summarizeTransactions = true;
ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess, summarizeTransactions);

//Indicates if the email notifications should be sent after each individual process has completed
config.shouldSendEmailAtEndOfProcesses = false;

Properties

Name Type Description
firstProcess ffrr.RevenueScheduleAutomationService.AutomationProcess The first process to be run. All processes between this (inclusive) and the lastProcess (inclusive) will be run, following the order of processes in the AutomationProcess enum. e.g. if firstProcess = Generate and lastProcess = Summarize, then Generate, Recognize and Summarize will be run in that order.
lastProcess ffrr.RevenueScheduleAutomationService.AutomationProcess The last process to be run. All processes between firstProcess (inclusive) and this (inclusive) will be run, following the order of processes in the AutomationProcess enum. e.g. if firstProcess = Generate and lastProcess = Summarize, then Generate, Recognize and Summarize will be run in that order.
summarizeTransactions Boolean Indicates if the summarization process should run when Summarize is included in the processes to run. If false, the summarization process will not run even when Summarize is included in the processes to run. This allows running processes before and after Summarize together in one API call while skipping the summarization process itself. Note: If Summarize is the only process selected to run and this option is set to false, an exception will be thrown if an attempt is made to run a process with that AutomationConfig instance.
Also, when running the CreateJournals process (regardless of whether Summarize is included in the processes to run), indicates if journals should be created from transaction summaries (if true) or transaction lines (if false).
Defaults to true
shouldSendEmailAtEndOfProcesses Boolean Indicates if email notifications should be sent after each individual process has completed. Note that with this option set to false, no email notifications will be sent at all as a result of the API call.
Defaults to true

Methods

AutomationConfig

global AutomationConfig(ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess, ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess)

AutomationConfig

global AutomationConfig(ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess, ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess, Boolean summarizeTransactions)

ffrr.RevenueScheduleAutomationService.AutomationResult

global with sharing class AutomationResult

Class used to return results of automation API call.

© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.