ERP Core

fferpcore.FeatureConsoleService

global with sharing class FeatureConsoleService

Retrieve and activate Feature Console features and steps.

Methods

readFeatures

global static List<fferpcore.FeatureConsoleService.Feature> readFeatures()

Reads all available features from the database and whether or not they are enabled.

Return Value

The list of all features

readFeatures

global static List<fferpcore.FeatureConsoleService.Feature> readFeatures(Set<String> qualifiedFeatureNames)

Reads the specified features from the database and whether or not they are enabled.

Input Parameters

Name Type Description
qualifiedFeatureNames Set<String> The qualified API names of the feature to read.

Return Value

The list of features for the given names.

readFeatureSteps

global static List<fferpcore.FeatureConsoleService.Step> readFeatureSteps(Set<String> qualifiedFeatureNames)

Reads all feature steps from the database for a given set of features and whether or not they have been marked as completed.

Input Parameters

Name Type Description
qualifiedFeatureNames Set<String> The qualified API names of the features to read steps for.

Return Value

The list of all feature steps for the given features.

readFeatureSteps

global static List<fferpcore.FeatureConsoleService.Step> readFeatureSteps(Set<String> qualifiedFeatureNames, fferpcore.FeatureConsoleService.ReadFeatureStepsOptions options)

Reads all feature steps from the database for a given set of features and whether or not they have been marked as completed.

Input Parameters

Name Type Description
qualifiedFeatureNames Set<String> The qualified API names of the features to read steps for.
options fferpcore.FeatureConsoleService.ReadFeatureStepsOptions The options to use when reading the steps.

Return Value

The list of all feature steps for the given features.

enable

global static fferpcore.FeatureConsoleService.ActivationResponse enable(Id recordId)

Marks a given feature or feature step as enabled or completed.

Input Parameters

Name Type Description
recordId Id The ID of the custom metadata record representing the feature or step to enable.

Return Value

Whether the enable request was successful and if not any errors encountered.

disable

global static fferpcore.FeatureConsoleService.ActivationResponse disable(Id recordId)

Marks a given feature or feature step as disabled or not completed.

Input Parameters

Name Type Description
recordId Id The ID of the custom metadata record representing the feature or step to disable.

Return Value

Whether the disable request was successful and if not any errors encountered.

skip

global static fferpcore.FeatureConsoleService.ActivationResponse skip(Id recordId)

Marks a given feature step as skipped.

Input Parameters

Name Type Description
recordId Id The ID of the custom metadata record representing the step to skip.

Return Value

Whether the skip request was successful and if not any errors encountered.

isFeatureEnabled

global static Map<String, Boolean> isFeatureEnabled(Set<String> qualifiedFeatureNames)

Determines whether a given set of features have been enabled.

Input Parameters

Name Type Description
qualifiedFeatureNames Set<String> The qualified API names of the features to check.

Return Value

A map of the qualified API names of the passed in features against whether they are enabled.

getLogLines

global static List<fferpcore.FeatureConsoleService.LogLine> getLogLines(Set<String> qualifiedFeatureNames)

Reads all of the LogLines associated with the given set of features.

Input Parameters

Name Type Description
qualifiedFeatureNames Set<String> The qualified API names of the features.

Return Value

A list of requested LogLines.

markAsPerformed

global static void markAsPerformed(Boolean isEnable, Id recordId, LoggingLevel severity)

Mark a feature or step as performed.

Input Parameters

Name Type Description
isEnable Boolean Whether we are trying to enable or disable.
recordId Id The ID of the feature or step record to mark as performed.
severity LoggingLevel The highest logging level used for any issues logged during enabling or disabling. Used to set the status of the feature or step.

markAsError

global static void markAsError(Boolean isEnable, Id recordId, Exception e)

Mark a feature or step as having had an error.

Input Parameters

Name Type Description
isEnable Boolean Whether we are trying to enable or disable.
recordId Id The ID of the feature or step record to mark as having had an error.
e Exception The exception causing the error.

markAsError

global static void markAsError(Boolean isEnable, Id recordId, LoggingLevel severity, String error)

Mark a feature or step as having had an error.

Input Parameters

Name Type Description
isEnable Boolean Whether we are trying to enable or disable.
recordId Id The ID of the feature or step record to mark as having had an error.
severity LoggingLevel The severity of the error.
error String A detail message for the error

log

global static void log(fferpcore.FeatureConsoleService.LogRequest request)

Log a message against the running of a particular feature or step.

Input Parameters

Name Type Description
request fferpcore.FeatureConsoleService.LogRequest Request object containing the details of what to log and against which feature or step.

fferpcore.FeatureConsoleService.Feature

global class Feature

Wrapper for a Feature Console feature and whether it has been enabled.

Properties

Name Type Description
Record FeatureConsoleFeature__mdt The custom metadata object representing the feature.
IsActive Boolean Whether the feature has been enabled.

Methods

Feature

global Feature()

getCanToggle

global Boolean getCanToggle()

fferpcore.FeatureConsoleService.Step

global class Step

Wrapper for a Feature Console feature step and whether it has been marked as completed.

Properties

Name Type Description
Record FeatureConsoleFeatureStep__mdt The custom metadata object representing the feature step.
IsActive Boolean Whether the feature step has been marked as completed.

Methods

Step

global Step()

fferpcore.FeatureConsoleService.ActivationResponse

global class ActivationResponse

Response returned when enabling or disabling a step or feature.

Properties

Name Type Description
Success Boolean Whether the feature or step was successfully enabled or disabled.
Messages List<String> A list of the errors if the request was not successful.

Methods

ActivationResponse

global ActivationResponse()

fferpcore.FeatureConsoleService.LogLine

global class LogLine

A line of logging generated when performing a feature or step

Properties

Name Type Description
Feature String The feature this log relates to
Step String The step this log relates to, if any.
Severity String The seriousness of the event
Message String A description of the event
ActivationNumber Integer The activation number - log lines with the same activation number relate to the same feature activation.

Methods

LogLine

global LogLine()

fferpcore.FeatureConsoleService.StepRunnerConfig

global class StepRunnerConfig

The information passed to a custom Apex runner when running a feature step.

Properties

Name Type Description
IsEnable Boolean Whether we are trying to enable or disable the step.
ParamsByType Map<String, List<FeatureConsoleFeatureParameter__mdt>> The parameters for the step being run mapped by their parameter types.
StepRecordId Id The ID of the custom metadata record for the step we are trying to run.

Methods

StepRunnerConfig

global StepRunnerConfig()

fferpcore.FeatureConsoleService.LogRequest

global class LogRequest

Wrapper for the information required to log a message against the running of a step or feature.

Properties

Name Type Description
IsEnable Boolean Whether we are trying to enable or disable the feature or step.
RecordId Id The ID of the feature or step record we are trying to log the message against.
Severity LoggingLevel The severity to log the message under.
Detail String The message to log against the feature or step.

Methods

LogRequest

global LogRequest()

fferpcore.FeatureConsoleService.StepDescriptionLine

global class StepDescriptionLine

fferpcore.FeatureConsoleService.ReadFeatureStepsOptions

global class ReadFeatureStepsOptions

A wrapper for the options used when reading feature steps.

Properties

Name Type Description
ResolveLabels Boolean A flag indicating whether to resolve labels when reading a Feature Step description. This defaults to true so will fail if called outside of a VisualForce context.

Methods

ReadFeatureStepsOptions

global ReadFeatureStepsOptions()

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