Extended Planning and Analysis

xPNA.GlobalPlanService

global with sharing class GlobalPlanService

This class contains global methods to perform plan related operations.

Enums

FilterComparisonOperator

An enum that represents the valid options for operator types.

Value Description
EQUAL Displays the operator types equals.
NOT_EQUAL Displays the operator type not equals.
CONTAINS Displays the operator type contains.
NOT_CONTAINS Displays the operator type not contains.
START_WITH Displays the operator type start with.
IS_NULL Displays the operator type null.
IS_NOT_NULL Displays the operator type not null.

Methods

createBlankPlans

global static xPNA.GlobalPlanService.PlanBlankCreateResponseCollection createBlankPlans(xPNA.GlobalPlanService.PlanBlankCreateRequestCollection request)

Creates a blank plan.

Input Parameters

Name Type Description
request xPNA.GlobalPlanService.PlanBlankCreateRequestCollection Contains the information needed to create a blank plan.

Return Value

The PlanBlankCreateResponse of the newly created plan.

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.


//Create an instance of PlanBlankCreateRequest.
xpna.GlobalPlanService.PlanBlankCreateRequest request = new xpna.GlobalPlanService.PlanBlankCreateRequest();
request.planName = 'Blank Plan Example Name';
request.currentScenarioName = 'Initial';
request.description = 'Description';

//Get dimensions that are used to create the plan as rows.
List<xpna__Dimension__c> dimensionRowsList = [SELECT Id FROM xpna__Dimension__c WHERE Name LIKE 'DimensionRows%' ORDER BY Name];
request.dimensionRowIds = new List<Id>(new Map<Id, xpna__Dimension__c>(dimensionRowsList).keySet());

//Get dimensions that are used to create the plan as columns.
List<xpna__Dimension__c> dimensionColumnsList = [SELECT Id FROM xpna__Dimension__c WHERE Name LIKE 'DimensionColumns%' ORDER BY Name];
request.dimensionColumnIds = new List<Id>(new Map<Id, xpna__Dimension__c>(dimensionColumnsList).keySet());

//Get the measures that are used to create the plan.
List<xpna__Measure__c> measureList = [SELECT Id FROM xpna__Measure__c WHERE Name Like 'Measure%'];
request.measureIds = new List<Id>(new Map<Id, xpna__Measure__c>(measureList).keySet());

//Optional, by default it is true if you do not provide it.
request.measureAsColumns = true;

//Create an instance of the object request.
xpna.GlobalPlanService.PlanBlankCreateRequestCollection requestCollection = new xpna.GlobalPlanService.PlanBlankCreateRequestCollection();
//Add a new PlanBlankCreateRequest to the request list.
requestCollection.planBlankCreateRequests.add(request);

//Call the API method.
xpna.GlobalPlanService.PlanBlankCreateResponseCollection result = xpna.GlobalPlanService.createBlankPlans(requestCollection);

createPlansFromAnalytics

global static xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponseCollection createPlansFromAnalytics(xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection request)

Creates a plan from Analytics data source.

Input Parameters

Name Type Description
request xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection Contains the information needed to create a plan from data source.

Return Value

The PlanFromAnalyticsCreateResponse of the newly created plan.

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.


//Create an instance of PlanFromAnalyticsCreateRequest.
xpna.GlobalPlanService.PlanFromAnalyticsCreateRequest request = new xpna.GlobalPlanService.PlanFromAnalyticsCreateRequest();
request.planName = 'Plan From Analytics Example Name';
request.currentScenarioName = 'Initial';
request.description = 'Description';

//Get the Data Source that is used to create the plan.
List<xpna__DataSource__c> dataSourceList = [SELECT Id, xpna__DatasetApiName__c FROM xpna__DataSource__c WHERE Name = 'Data Source'];
Id dataSourceId = dataSourceList[0].Id;
request.dataSourceId = dataSourceId;

//Get dimensions that are used to create the plan as rows.
List<xpna__Dimension__c> dimensionRowsList = [SELECT Id FROM xpna__Dimension__c WHERE Name LIKE 'DimensionRows%' ORDER BY Name];
request.dimensionRowIds = new List<Id>(new Map<Id, xpna__Dimension__c>(dimensionRowsList).keySet());

//Get dimensions that are used to create the plan as columns.
List<xpna__Dimension__c> dimensionColumnsList = [SELECT Id FROM xpna__Dimension__c WHERE Name LIKE 'DimensionColumns%' ORDER BY Name];
request.dimensionColumnIds = new List<Id>(new Map<Id, xpna__Dimension__c>(dimensionColumnsList).keySet());

//Get the measures that are used to create the plan.
List<xpna__Measure__c> measureList = [SELECT Id FROM xpna__Measure__c WHERE Name LIKE 'Measure%'];
request.measureIds = new List<Id>(new Map<Id, xpna__Measure__c>(measureList).keySet());

//Optional, by default it is true if you do not provide it.
request.measureAsColumns = true;

//Optional, set a dimension value map.
Id dimensionMapped = dimensionColumnsList[0].Id;
Map<String, String> valueMappings = new Map<String, String>();
valueMappings.put('Australia', 'Spain');
valueMappings.put('United Kingdom', 'Spain');

Map<Id, Map<String, String>> dimensionValueMappings = new Map<Id, Map<String, String>>();
dimensionValueMappings.put(dimensionMapped, valueMappings);

xpna.GlobalPlanService.DimensionValueMappingCollection dimensionValueMappingCollection = new xpna.GlobalPlanService.DimensionValueMappingCollection(); 
dimensionValueMappingCollection.dimensionValueMappings = dimensionValueMappings;
request.valueMappings = dimensionValueMappingCollection;

//Optional, filters for the dimension value.
xpna.GlobalPlanService.ListFilterCollection filterCollection = new xpna.GlobalPlanService.ListFilterCollection();
List<xpna.GlobalPlanService.DimensionFilter> dimensionFilters = new List<xpna.GlobalPlanService.DimensionFilter>();

xpna.GlobalPlanService.DimensionFilter filter = new xpna.GlobalPlanService.DimensionFilter();
filter.dimensionId = dimensionRowsList[0].Id;
filter.comparisonOperator = xpna.GlobalPlanService.FilterComparisonOperator.EQUAL;
// values are different in every dataset, use yours
filter.values = new List<String>{'Adelaide', 'Birmingham'};

dimensionFilters.add(filter);
filterCollection.filters = dimensionFilters;
request.filters = filterCollection;

//Create an instance of the object request.
xpna.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection requestCollection = new xpna.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection();
//Add a new PlanFromAnalyticsCreateRequest to the request list.
requestCollection.planFromAnalyticsCreateRequests.add(request);

//Call the API method.
xpna.GlobalPlanService.PlanFromAnalyticsCreateResponseCollection result = xpna.GlobalPlanService.createPlansFromAnalytics(requestCollection);

deletePlans

global static xPNA.GlobalPlanService.PlanDeleteResponseCollection deletePlans(xPNA.GlobalPlanService.PlanDeleteRequestCollection request)

Deletes the plans.

Input Parameters

Name Type Description
request xPNA.GlobalPlanService.PlanDeleteRequestCollection The list of PlanDeleteRequest.

Return Value

A list of PlanResponse.

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.


//Create an instance of the object request.
xpna.GlobalPlanService.PlanDeleteRequestCollection request = new xpna.GlobalPlanService.PlanDeleteRequestCollection();

//Create an instance of PlanDeleteRequest and set the ID of the plan to be deleted.
xpna.GlobalPlanService.PlanDeleteRequest planToDeleteRequest = new xpna.GlobalPlanService.PlanDeleteRequest();
planToDeleteRequest.planId = Id.valueOf('a0D7X0000050TrEUAU');

//Add a new PlanDeleteRequest to the request list.
request.planDeleteRequests.add(planToDeleteRequest);

//Call the API method.
xpna.GlobalPlanService.PlanDeleteResponseCollection result = xpna.GlobalPlanService.deletePlans(request);

xPNA.GlobalPlanService.DimensionFilter

global with sharing class DimensionFilter extends Filter

Represents the information needed to filter a dimension.

This class extends xPNA.GlobalPlanService.Filter

Properties

Name Type Description
dimensionId Id The ID of the dimension to filter.
comparisonOperator xPNA.GlobalPlanService.FilterComparisonOperator The comparison operator.
values List<String> The values to compare.
Multiple values when comparisonOperator is:
FilterComparisonOperator.EQUALS FilterComparisonOperator.NOT_EQUAL
Only one value when comparisonOperator is:
FilterComparisonOperator.CONTAINS FilterComparisonOperator.NOT_CONTAINS FilterComparisonOperator.START_WITH
Empty values when comparisonOperator is:
FilterComparisonOperator.IS_NULL FilterComparisonOperator.IS_NOT_NULL

Methods

DimensionFilter

global DimensionFilter()

Creates a new empty DimensionFilter.

xPNA.GlobalPlanService.ValueMappingCollection

global with sharing abstract class ValueMappingCollection

Represents the mappings to be used when creating a plan from Analytics.

xPNA.GlobalPlanService.DimensionValueMappingCollection

global with sharing class DimensionValueMappingCollection extends ValueMappingCollection

Provides the information about the value mapping for a given dimension to be used when creating a plan from Analytics.

This class extends xPNA.GlobalPlanService.ValueMappingCollection

Properties

Name Type Description
dimensionValueMappings Map<Id, Map<String, String>> Contains a map with the dimension ID, the original value, and the new ones.

Methods

DimensionValueMappingCollection

global DimensionValueMappingCollection()

Creates a new empty DimensionValueMappingCollection.

xPNA.GlobalPlanService.Filter

global with sharing abstract class Filter

Contains the required information of the plan delete operation. Represents a filter to be used when creating a plan from Analytics.

xPNA.GlobalPlanService.FilterCollection

global with sharing abstract class FilterCollection

Represents the filters to be used when creating a plan from Analytics.

xPNA.GlobalPlanService.ListFilterCollection

global with sharing class ListFilterCollection extends FilterCollection

Provides the information about the simple version of dimension filters (AND operator) to be used when creating a plan from Analytics.

This class extends xPNA.GlobalPlanService.FilterCollection

Properties

Name Type Description
filters List<xPNA.GlobalPlanService.Filter> The list of filters to be used when creating a plan from Analytics.

Methods

ListFilterCollection

global ListFilterCollection()

Creates a new empty ListFilterCollection.

xPNA.GlobalPlanService.PlanBlankCreateRequest

global with sharing class PlanBlankCreateRequest extends PlanCreateRequest

Contains methods and structures that are used to create a blank plan.

This class extends xPNA.GlobalPlanService.PlanCreateRequest

Methods

PlanBlankCreateRequest

global PlanBlankCreateRequest()

Creates a new empty PlanBlankCreateRequest.

xPNA.GlobalPlanService.PlanBlankCreateRequestCollection

global with sharing class PlanBlankCreateRequestCollection

Contains methods and structures that are used to create a blank plan.

Properties

Name Type Description
planBlankCreateRequests List<xPNA.GlobalPlanService.PlanBlankCreateRequest> Creates a new empty PlanBlankCreateRequestCollection.

Methods

PlanBlankCreateRequestCollection

global PlanBlankCreateRequestCollection()

Creates a new empty PlanBlankCreateRequestCollection.

xPNA.GlobalPlanService.PlanBlankCreateResponse

global virtual with sharing class PlanBlankCreateResponse

Contains a structure that returns the creation of a blank plan.

Properties

Name Type Description
planId Id The ID of the newly created plan.

Methods

PlanBlankCreateResponse

global PlanBlankCreateResponse()

Creates a new empty PlanBlankCreateResponse.

xPNA.GlobalPlanService.PlanBlankCreateResponseCollection

global with sharing class PlanBlankCreateResponseCollection

Contains a structure that returns the creation of blank plans.

Properties

Name Type Description
planBlankCreateResponses List<xPNA.GlobalPlanService.PlanBlankCreateResponse> A list of PlanBlankCreateResponse.

Methods

PlanBlankCreateResponseCollection

global PlanBlankCreateResponseCollection()

Creates a new empty PlanBlankCreateResponseCollection.

xPNA.GlobalPlanService.PlanCreateRequest

global virtual with sharing class PlanCreateRequest

Provides the information required to create a plan.

Properties

Name Type Description
currentScenarioName String The current version of the plan.
description String [Optional] The description of the plan.
dimensionColumnIds List<Id> The set of the used dimensions in the plan columns.
dimensionRowIds List<Id> The dimensions set used in the plan rows.
measureAsColumns Boolean The condition to establish if measures are columns (true) or rows (false).
measureIds List<Id> List of the measures IDs to create the plan.
planName String The plan name.

Methods

PlanCreateRequest

global PlanCreateRequest()

Creates a new empty PlanCreateRequest.

xPNA.GlobalPlanService.PlanDeleteRequest

global with sharing class PlanDeleteRequest

Provides the information required to delete a plan.

Properties

Name Type Description
planId Id The ID of the plan to be deleted.

Methods

PlanDeleteRequest

global PlanDeleteRequest()

Default empty constructor to represent the class.

xPNA.GlobalPlanService.PlanDeleteRequestCollection

global with sharing class PlanDeleteRequestCollection

Contains the required information for the plan delete operation.

Properties

Name Type Description
planDeleteRequests List<xPNA.GlobalPlanService.PlanDeleteRequest> The list of PlanDeleteRequests object.

Methods

PlanDeleteRequestCollection

global PlanDeleteRequestCollection()

Default empty constructor to represent the class outside the namespace.

xPNA.GlobalPlanService.PlanDeleteResponse

global with sharing class PlanDeleteResponse

Contains the returning information of the delete plan operation.

Properties

Name Type Description
planId Id The ID of the newly created plan.
asyncJobId Id The ID of the asynchronous job.

Methods

PlanDeleteResponse

global PlanDeleteResponse()

Default empty constructor to represent the class outside the namespace.

xPNA.GlobalPlanService.PlanDeleteResponseCollection

global with sharing class PlanDeleteResponseCollection

Contains the returning information of the plan delete operation.

Properties

Name Type Description
planDeleteResponses List<xPNA.GlobalPlanService.PlanDeleteResponse> A list of PlanDeleteResponse.

Methods

PlanDeleteResponseCollection

global PlanDeleteResponseCollection()

Default empty constructor to represent the class outside the namespace.

xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequest

global with sharing class PlanFromAnalyticsCreateRequest extends PlanCreateRequest

Contains methods and structures that are used to create a plan from an Analytics data source.

This class extends xPNA.GlobalPlanService.PlanCreateRequest

Properties

Name Type Description
dataSourceId Id The identificator that contains the data source related to the plan.
filters xPNA.GlobalPlanService.FilterCollection The collection of filters to apply to the plan's Analytics query.
valueMappings xPNA.GlobalPlanService.ValueMappingCollection The collection of mappings to apply to the plan's Analytics query.

Methods

PlanFromAnalyticsCreateRequest

global PlanFromAnalyticsCreateRequest()

Creates a new empty PlanFromAnalyticsCreateRequest.

xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection

global with sharing class PlanFromAnalyticsCreateRequestCollection

Contains methods and structures that are used to create a plan from an Analytics data source.

Properties

Name Type Description
planFromAnalyticsCreateRequests List<xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequest> The list of PlanFromAnalyticsCreateRequest object.

Methods

PlanFromAnalyticsCreateRequestCollection

global PlanFromAnalyticsCreateRequestCollection()

Creates a new empty PlanFromAnalyticsCreateRequestCollection.

xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponse

global virtual with sharing class PlanFromAnalyticsCreateResponse

Contains a structure that returns the creation of a plan from Analytics.

Properties

Name Type Description
planId Id The ID of the newly created plan.
jobId Id The ID of the created job.

Methods

PlanFromAnalyticsCreateResponse

global PlanFromAnalyticsCreateResponse()

Creates a new empty PlanFromAnalyticsCreateResponse.

xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponseCollection

global with sharing class PlanFromAnalyticsCreateResponseCollection

Contains a structure that returns the creation of plans from Analytics.

Properties

Name Type Description
planFromAnalyticsCreateResponses List<xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponse> A list of PlanBlankCreateResponse.

Methods

PlanFromAnalyticsCreateResponseCollection

global PlanFromAnalyticsCreateResponseCollection()

Creates a new empty PlanFromAnalyticsCreateResponseCollection.

xPNA.GlobalPlanService.GlobalPlanServiceException

global with sharing class GlobalPlanServiceException extends ServiceException

This class is thrown when an error is detected within the xPNA.GlobalPlanService class.

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.