xPNA.GlobalPlanServiceglobal with sharing class GlobalPlanService
This class contains global methods to perform plan related operations. EnumsFilterComparisonOperatorRepresents the condition operators that you can use to apply filter logic.
FilterLogicalOperatorRepresents the operators that you can use to apply filter logic.
Methods
createBlankPlansglobal static xPNA.GlobalPlanService.PlanBlankCreateResponseCollection createBlankPlans(xPNA.GlobalPlanService.PlanBlankCreateRequestCollection request) Creates a blank plan. Input Parameters
Return ValueThe 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); createPlansFromAnalyticsglobal static xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponseCollection createPlansFromAnalytics(xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestCollection request) Creates a plan from Analytics data source. Input Parameters
Return ValueThe 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(); filterCollection.logicalOperator = GlobalPlanService.FilterLogicalOperator.OR_LOGIC; // Same logical operator for all filters List<xpna.GlobalPlanService.DimensionFilter> dimensionFilters = new List<xpna.GlobalPlanService.DimensionFilter>(); xpna.GlobalPlanService.DimensionFilter filter1 = new xpna.GlobalPlanService.DimensionFilter(); filter1.dimensionId = dimensionRowsList[0].Id; filter1.comparisonOperator = xpna.GlobalPlanService.FilterComparisonOperator.EQUAL; // values are different in every dataset, use yours filter1.values = new List<String>{'Adelaide'}; xpna.GlobalPlanService.DimensionFilter filter2 = new xpna.GlobalPlanService.DimensionFilter(); filter2.dimensionId = dimensionRowsList[0].Id; filter2.comparisonOperator = xpna.GlobalPlanService.FilterComparisonOperator.EQUAL; // values are different in every dataset, use yours filter2.values = new List<String>{'Birmingham'}; dimensionFilters.add(filter1); dimensionFilters.add(filter2); 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); deletePlansglobal static xPNA.GlobalPlanService.PlanDeleteResponseCollection deletePlans(xPNA.GlobalPlanService.PlanDeleteRequestCollection request) Deletes the plans. Input Parameters
Return ValueA 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.DimensionFilterglobal with sharing class DimensionFilter extends Filter Represents the information needed to filter a dimension. This class extends xPNA.GlobalPlanService.Filter Properties
MethodsxPNA.GlobalPlanService.ValueMappingCollectionglobal with sharing abstract class ValueMappingCollection Represents the mappings to be used when creating a plan from Analytics. xPNA.GlobalPlanService.DimensionValueMappingCollectionglobal 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
MethodsDimensionValueMappingCollectionglobal DimensionValueMappingCollection() Creates a new empty DimensionValueMappingCollection. xPNA.GlobalPlanService.Filterglobal 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.FilterCollectionglobal with sharing abstract class FilterCollection Represents the filters to be used when creating a plan from Analytics. xPNA.GlobalPlanService.ListFilterCollectionglobal 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
MethodsxPNA.GlobalPlanService.PlanBlankCreateRequestglobal with sharing class PlanBlankCreateRequest extends PlanCreateRequest Contains methods and structures that are used to create a blank plan. This class extends xPNA.GlobalPlanService.PlanCreateRequest MethodsxPNA.GlobalPlanService.PlanBlankCreateRequestCollectionglobal with sharing class PlanBlankCreateRequestCollection Contains methods and structures that are used to create a blank plan. Properties
MethodsPlanBlankCreateRequestCollectionglobal PlanBlankCreateRequestCollection() Creates a new empty PlanBlankCreateRequestCollection. xPNA.GlobalPlanService.PlanBlankCreateResponseglobal virtual with sharing class PlanBlankCreateResponse Contains a structure that returns the creation of a blank plan. Properties
MethodsPlanBlankCreateResponseglobal PlanBlankCreateResponse() Creates a new empty PlanBlankCreateResponse. xPNA.GlobalPlanService.PlanBlankCreateResponseCollectionglobal with sharing class PlanBlankCreateResponseCollection Contains a structure that returns the creation of blank plans. Properties
MethodsPlanBlankCreateResponseCollectionglobal PlanBlankCreateResponseCollection() Creates a new empty PlanBlankCreateResponseCollection. xPNA.GlobalPlanService.PlanCreateRequestglobal virtual with sharing class PlanCreateRequest Provides the information required to create a plan. Properties
MethodsxPNA.GlobalPlanService.PlanDeleteRequestglobal with sharing class PlanDeleteRequest Provides the information required to delete a plan. Properties
MethodsxPNA.GlobalPlanService.PlanDeleteRequestCollectionglobal with sharing class PlanDeleteRequestCollection Contains the required information for the plan delete operation. Properties
MethodsPlanDeleteRequestCollectionglobal PlanDeleteRequestCollection() Default empty constructor to represent the class outside the namespace. xPNA.GlobalPlanService.PlanDeleteResponseglobal with sharing class PlanDeleteResponse Contains the returning information of the delete plan operation. Properties
MethodsPlanDeleteResponseglobal PlanDeleteResponse() Default empty constructor to represent the class outside the namespace. xPNA.GlobalPlanService.PlanDeleteResponseCollectionglobal with sharing class PlanDeleteResponseCollection Contains the returning information of the plan delete operation. Properties
MethodsPlanDeleteResponseCollectionglobal PlanDeleteResponseCollection() Default empty constructor to represent the class outside the namespace. xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestglobal 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
MethodsPlanFromAnalyticsCreateRequestglobal PlanFromAnalyticsCreateRequest() Creates a new empty PlanFromAnalyticsCreateRequest. xPNA.GlobalPlanService.PlanFromAnalyticsCreateRequestCollectionglobal with sharing class PlanFromAnalyticsCreateRequestCollection Contains methods and structures that are used to create a plan from an Analytics data source. Properties
MethodsPlanFromAnalyticsCreateRequestCollectionglobal PlanFromAnalyticsCreateRequestCollection() Creates a new empty PlanFromAnalyticsCreateRequestCollection. xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponseglobal virtual with sharing class PlanFromAnalyticsCreateResponse Contains a structure that returns the creation of a plan from Analytics. Properties
MethodsPlanFromAnalyticsCreateResponseglobal PlanFromAnalyticsCreateResponse() Creates a new empty PlanFromAnalyticsCreateResponse. xPNA.GlobalPlanService.PlanFromAnalyticsCreateResponseCollectionglobal with sharing class PlanFromAnalyticsCreateResponseCollection Contains a structure that returns the creation of plans from Analytics. Properties
MethodsPlanFromAnalyticsCreateResponseCollectionglobal PlanFromAnalyticsCreateResponseCollection() Creates a new empty PlanFromAnalyticsCreateResponseCollection. xPNA.GlobalPlanService.GlobalPlanServiceExceptionglobal with sharing class GlobalPlanServiceException extends ServiceException This class is thrown when an error is detected within the xPNA.GlobalPlanService class. |