Analytic Type Classes

This chapter provides an overview of Analytic Calculation Engine classes and discuses:

Important! The analytic type classes are not supported on IBM z/OS and Linux for IBM System z platforms.

Click to jump to parent topicUnderstanding the Analytic Calculation Engine Classes

PeopleSoft Analytic Calculation Engine comprises a calculation engine plus several PeopleTools features which enable application developers to define both the calculation rules and the display of calculated data within PeopleSoft applications for the purposes of multi-dimensional reporting, data editing, and analysis.

More specifically, developers create analytic models in order to define the rules which are used to calculate data. Developers also create PeopleSoft Pure Internet Architecture pages with analytic grids in order to display the data within PeopleSoft applications. End users view, analyze and make changes to this data. When end users save their changes, PeopleSoft Analytic Calculation Engine recalculates the data and saves the calculated data to the database.

PeopleCode enables developers to manipulate analytic calculation data as follows:

See Also

Analytic Calculation Engine Metadata Classes

Analytic Grid Classes

Enterprise PeopleTools 8.51 PeopleBook: Analytic Calculation Engine

Click to jump to parent topicUsing the Analytic Type Classes

You can create analytic type definitions using Application Designer. PeopleSoft provides the analytic type classes for accessing these definitions at runtime.

You can also create an analytic type definition in PeopleCode, using the Create method, then saving it to the database using the Save method. After you save the definition, you can access it using Application Designer.

You only need to create an instance of the analytic type. All other objects are instantiated from the analytic type object.

Once the AnalyticTypeDefn object is created, you can then execute either the Get or Create methods to “instantiate” the analytic type object.

Click to jump to parent topicError Handling

All the analytic type classes throw PeopleCode exceptions for any fatal error that occurs in the execution of the operation. PeopleSoft recommends enclosing your analytic model programs in try-catch statements. This way, if your program catches the exception, the message set and message number that are associated with the exception object indicate the error.

See Also

Try-Catch Sections

Click to jump to parent topicData Types of the Analytic Type Objects

Every PeopleSoft analytic type object is declared as its own data type, that is, AnalyticTypeDefn objects are declared as type AnalyticTypeDefn, AnalyticTypeModelDefn objects are declared as type AnalyticTypeModelDefn, and so on.

The following are the data types for the PeopleSoft analytic type classes:

Click to jump to parent topicScope of Analytic Type Objects

The analytic type objects can only be instantiated from PeopleCode.

These objects can be used anywhere you have PeopleCode, that is, in a Application Engine program, an application class, record field PeopleCode, and so on.

Analytic type objects can be of scope Local, Component or Global.

Click to jump to parent topicHow to Import the Analytic Type Classes

The analytic type classes are not built-in classes, like Rowset, Field, Record, and so on. They are application classes. Before you can use these classes in your PeopleCode program, you must import them to your program.

An import statement names either all the classes in a package or one particular application class. For importing the analytic type classes, PeopleSoft recommends that you import all the classes in the application package.

The application package PT_ANALYTICTYPEDEFN contains the following subclasses:

The import statement you should use should be as follows:

import PT_ANALYTICTYPEDEFN:*;

Using the asterisks after the package name makes all the application classes directly contained in the named package available.

See Also

Application Classes

Click to jump to parent topicHow to Create an Analytic Type Class Object

After you've imported the analytic type classes, you need to instantiate an instance of the AnalyticTypeDefn class, using the constructor for that class and the Create function. After you create the object, you must populate it using either the Get or Create method.

The following example creates an AnalyticTypeDefn object from the QE_ACE_ALLFUNCTION analytic type definition.

Local PT_ANALYTICTYPEDEFN:AnalyticTypeDefn &AnalyticType; &AnalyticType = create PT_ ANALYTICTYPEDEFN:AnalyticTypeDefn("QE_ACE_ALLFUNCTION");

See Also

Analytic Calculation Engine Metadata Classes Constructor

Click to jump to parent topicAnalytic Type Classes Constructor

You must use the constructor for the AnalyticTypeDefn class to instantiate an instance of that class. All other objects are instantiated from this class.

Click to jump to top of pageClick to jump to parent topicAnalyticTypeDefn

Syntax

AnalyticTypeDefn(TypeName)

Description

Use the AnalyticTypeDefn constructor to create an AnalyticTypeDefn.

Once the AnalyticTypeDefn object is created, you can then execute either the Get or Create methods to instantiate the model.

Note. The Delete and Rename methods can only be executed before a model is instantiated.

Parameters

TypeName

Specify the name of an analytic type definition.

Returns

An AnalyticTypeDefn object.

Example

&Model = create AnalyticTypeDefn("QE_ACE_ALLFUNCTION");

See Also

AnalyticTypeDefn

Click to jump to parent topicAnalyticTypeDefn Class Methods

This section describes the analytic type definition class methods. The methods are discussed in alphabetical order.

Click to jump to top of pageClick to jump to parent topicAddModel

Syntax

AddModel(ModelName, ModelType)

Description

Use the AddModel method to add either an analytic model or optimization model to the analytic type definition. If the model doesn't exist, this method fails.

Parameters

ModelName

Specify the name of an existing model.

ModelType

Specify the model type. Values are:

 

Value

Description

%ModelType_ACE

The model is an Analytic Calculation Engine.

%ModelType_OPT

The model is an optimization.

Returns

The new AnalyticTypeModelDefn object.

See Also

DeleteModel, GetModelNames.

AnalyticTypeModelDefn Class Properties

Click to jump to top of pageClick to jump to parent topicAddRecord

Syntax

AddRecord(RecordName)

Description

Use the AddRecord method to add a record to the analytic type definition. If the record definition doesn't exist in Application Designer, or if the record already exists in this analytic type definition, this method fails.

Parameters

RecordName

Specify the name of the record that you want to add.

Returns

An AnalyticTypeRecordDefn object that represents the record.

See Also

DeleteRecord, GetRecordNames.

AnalyticTypeRecordDefn Class Methods

Click to jump to top of pageClick to jump to parent topicCreate

Syntax

Create()

Description

Use the Create method to create, and instantiate, a new analytic type. If the analytic type already exists, an exception is thrown.

Parameters

None.

Returns

None.

See Also

Save

Try-Catch Sections

Click to jump to top of pageClick to jump to parent topicCopyTo

Syntax

CopyTo(NewAnalyticTypeName)

Description

Use the CopyTo method to copy the current AnalyticTypeDefn object to the AnalyticTypeDefn object with the specified name. This method fails if the analytic type specified with NewAnalyticTypeName already exists.

Parameters

NewAnalyticTypeName

Specify the name of the new analytic type definition that you want to create.

Returns

The new AnalyticTypeDefn object.

See Also

Create, Save.

Click to jump to top of pageClick to jump to parent topicDelete

Syntax

Delete()

Description

Use the Delete method to delete the analytic type definition. You must use this method immediately after you create the AnalyticType object, before you instantiate it, that is, before you use either the Get or Create method.

Note. This method executes immediately, and deletes the definition from Application Designer.

Parameters

None.

Returns

None.

See Also

Create, Get, Save.

Click to jump to top of pageClick to jump to parent topicDeleteModel

Syntax

DeleteModel(ModelName)

Description

Use the DeleteModel method to delete the specified model from the analytic type definition.

Note. The model is not deleted from the analytic type definition until you use the Save method.

Parameters

ModelName

Specify the name of a model that exists in the analytic type definition.

Returns

None.

See Also

AddModel, GetModelNames.

AnalyticTypeModelDefn Class Properties

Click to jump to top of pageClick to jump to parent topicDeleteRecord

Syntax

DeleteRecord(RecordName)

Description

Use the DeleteRecord method to delete a record from the analytic type definition.

Note. The record deleted from the analytic type definition until you use the Save method.

Parameters

RecordName

Specify the name of the record that you want to remove from the analytic type definition.

Returns

None.

See Also

AddRecord, GetRecordNames.

AnalyticTypeRecordDefn Class Methods

Click to jump to top of pageClick to jump to parent topicGet

Syntax

Get()

Description

Use the Get method to instantiate an existing analytic type definition as an AnalyticTypeDefn object. If the analytic type doesn't exist, this method throws an exception.

Parameters

None.

Returns

None.

See Also

Create, Save.

Click to jump to top of pageClick to jump to parent topicGetModel

Syntax

GetModel(ModelName)

Description

Use the GetModel method to return a reference to an AnalyticTypeModelDefn object.

This method fails if the model specified by ModelName doesn't exist.

Parameters

ModelName

Specify the name of the analytic type model definition that you want to access.

Returns

An AnalyticTypeModelDefn object.

See Also

AnalyticTypeModelDefn Class Properties.

Click to jump to top of pageClick to jump to parent topicGetModelNames

Syntax

GetModelNames()

Description

Use the GetModelNames method to return an array of string containing all the model names in this analytic type definition.

Parameters

None.

Returns

An array of string.

See Also

AddModel, DeleteModel.

AnalyticTypeModelDefn Class Properties

Click to jump to top of pageClick to jump to parent topicGetRecord

Syntax

GetRecord(RecordName)

Description

Use the GetRecord method to return a reference to an AnalyticTypeRecordDefn object.

This method fails if the record specified by RecordName doesn't exist.

Parameters

RecordName

Specify the name of the record that you want to access.

Returns

An AnalyticTypeRecordDefn object.

See Also

AnalyticTypeRecordDefn Class Methods.

Click to jump to top of pageClick to jump to parent topicGetRecordNames

Syntax

GetRecordNames()

Description

Use the GetRecordNames method to return an array of string containing the names of all the records associated with the analytic type definition.

Parameters

None.

Returns

An array of string.

See Also

AddRecord, DeleteRecord.

AnalyticTypeRecordDefn Class Methods

Click to jump to top of pageClick to jump to parent topicRename

Syntax

Rename(NewAnalyticTypeName)

Description

Use the Rename method to rename an existing analytic type definition to a new name. You must use this method immediately after you create the AnalyticType object, before you instantiate it, that is, before you use either the Get or Create method. The new name is not saved to the database until you use the Save method.

Parameters

NewAnalyticTypeName

Specify the new name for the analytic type definition.

Returns

None.

See Also

Save

Click to jump to top of pageClick to jump to parent topicSave

Syntax

Save()

Description

Use the Save method to save any changes that were made to the AnalyticTypeDefn object to the database.

Parameters

None.

Returns

None.

Click to jump to parent topicAnalyticTypeDefn Class Properties

In this section we discuss the AnalyticTypeDefn class properties. The properties are described in alphabetic order.

Click to jump to top of pageClick to jump to parent topicAppClassPath

Description

Use this property to specify the full name of the application package that contains the Create, Copy and Delete methods used with this analytic type definition.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicComments

Description

Use this property to specify comments for the analytic type.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicDescription

Description

Use this property to specify a description for the analytic type.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicName

Description

This property specifies the name of the AnalyticTypeDefn.

This property is read-only.

Click to jump to top of pageClick to jump to parent topicOwnerID

Description

This property specifies the owner ID for this AnalyticTypeDefn.

This property is read-write.

Click to jump to parent topicAnalyticTypeModelDefn Class Properties

In this section we discuss the AnalyticTypeModelDefn class properties. The properties are described in alphabetic order.

Click to jump to top of pageClick to jump to parent topicName

Description

This property specifies the name of the analytic type model.

This property is read-only.

Click to jump to top of pageClick to jump to parent topicType

Description

This property specifies the type of the analytic type model. Values are:

Value

Description

%ModelType_ACE

The model is an Analytic Calculation Engine.

%ModelType_OPT

The model is an optimization.

This property is read-only.

Click to jump to parent topicAnalyticTypeRecordDefn Class Methods

In this section we describe the AnalyticTypeRecordDefn class methods. The methods are discussed in alphabetic order.

Click to jump to top of pageClick to jump to parent topicGetSelectedField

Syntax

GetSelectedField()

Description

Use the GetSelectedField to return an array of string containing the names of the fields that are selected for this record.

Parameters

None.

Returns

An array of string.

See Also

SetSelectedField

Click to jump to top of pageClick to jump to parent topicSetSelectedField

Syntax

SetSelectedFields(FieldName)

Description

Use the SetSelectedField method to specify the name of the field that is selected for this record.

Parameters

FieldName

Specify the name of the field that you want to select.

Returns

None.

See Also

GetSelectedField

Click to jump to top of pageClick to jump to parent topicUnsetSelectedField

Syntax

UnsetSelectedField(FieldName)

Description

Use the UnsetSelectedField method to unselect the selected field.

This method throws an exception if the field specified by FieldName isn't selected.

Parameters

FieldName

Specify the name of the field that you want to deselect.

Returns

None.

Click to jump to parent topicAnalyticTypeRecordDefn Class Properties

In this section we discuss the AnalyticTypeRecordDefn class properties. The properties are described in alphabetic order.

All of the properties listed here can also be set for the analytic type definition using Application Designer.

See Also

Understanding Analytic Model Properties

Click to jump to top of pageClick to jump to parent topicCallback

Description

Use this property to specify whether this record has a callback. This property takes a Boolean value, true if the record has a callback, false otherwise.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicDescription

Description

Use this property to specify a description for the record.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicName

Description

This property specifies the name of the record.

This property is read-only.

Click to jump to top of pageClick to jump to parent topicReadable

Description

Use this property to specify whether this record is readable. This property takes a Boolean value, true if the record is readable, false otherwise.

This record is read-write.

Click to jump to top of pageClick to jump to parent topicReadOnce

Description

Use this property to specify whether this record is specified as read once. This property takes a Boolean value, true if the record is only read once, false otherwise.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicScenarioManaged

Description

Use this property to specify if the record is specified as scenario managed. This property takes a Boolean value, true if the record is scenario managed, false otherwise.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicSyncOrder

Description

This property specifies the synchronization order for the record. It returns an integer value.

This property is read-write.

Click to jump to top of pageClick to jump to parent topicWriteable

Description

Use this property to specify if a record is specified as writeable. This property takes a Boolean value, true if the record is writeable, false otherwise.

This property is read-write.

Click to jump to parent topicAnalyticType Classes Example

The following is a typical example of using the AnalyticType classes.

import PT_ANALYTICTYPEDEFN:*; Local PT_ANALYTICTYPEDEFN:AnalyticTypeDefn &AnalyticType; Local PT_ANALYTICTYPEDEFN:AnalyticTypeRecordDefn &AnalyticTypeRecordDefn; &AnalyticType = create PT_ ANALYTICTYPEDEFN:AnalyticTypeDefn("BB_TEST"); &AnalyticType.Create(); &AnalyticType.AddModel("QE_BAM_GENX", %ModelType_ACE); &AnalyticTypeRecordDefn = &AnalyticType.AddRecordl("QE_BAM_CCSMOKE"); &AnalyticTypeRecordDefn = &AnalyticType.AddRecordl("QE_BAM_FACTTBL"); &AnalyticType.Save();