Namespace: Consultingwerk.OERA
Class 
BusinessEntity Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.OERA.IBusinessEntity, Consultingwerk.OERA.IBusinessService, Consultingwerk.OERA.IHasContextID
Inherited by: Consultingwerk.Windows.Framework.Localization.UserInterfaceCultureBusinessEntity, Consultingwerk.BusinessEntityDesigner.Services.BusinessEntityBusinessEntity, Consultingwerk.BusinessEntityDesigner.Services.DatabaseSchemaBusinessEntity, Consultingwerk.SmartFramework.SmartBusinessEntity, Consultingwerk.SmartFramework.Authentication.UserBusinessEntity, Consultingwerk.SmartFramework.Authorization.FieldSecurityItemBusinessEntity, Consultingwerk.SmartFramework.Authorization.GroupBusinessEntity, Consultingwerk.SmartFramework.Authorization.MenuGroupBusinessEntity, Consultingwerk.SmartFramework.Authorization.SecurityAssignmentBusinessEntity, Consultingwerk.SmartFramework.Authorization.SecurityRealmBusinessEntity, Consultingwerk.SmartFramework.Authorization.SecurityTokenBusinessEntity, Consultingwerk.SmartFramework.Authorization.ToolbarSecurityItemBusinessEntity, Consultingwerk.SmartFramework.Authorization.UserGroupBusinessEntity, Consultingwerk.SmartFramework.Context.ContextStoreBusinessEntity, Consultingwerk.SmartFramework.Scheduler.SchedulerJobStatusBusinessEntity, Consultingwerk.SmartFramework.System.AttachmentBusinessEntity, Consultingwerk.SmartFramework.System.AttachmentRoleBusinessEntity, Consultingwerk.SmartFramework.System.CommentRoleBusinessEntity, Consultingwerk.SmartFramework.System.DeletionBusinessEntity, Consultingwerk.SmartFramework.System.KeyFieldAssignmentTypeBusinessEntity, Consultingwerk.SmartFramework.System.LanguageBusinessEntity, Consultingwerk.SmartFramework.System.LoginCompanyBusinessEntity, Consultingwerk.SmartFramework.System.MessageBusinessEntity, Consultingwerk.SmartFramework.System.RelationBusinessEntity, Consultingwerk.SmartFramework.System.SmartBusinessEntityBusinessEntity, Consultingwerk.SmartFramework.System.TableBusinessEntity, Consultingwerk.SmartFramework.System.TranslationBusinessEntity, Consultingwerk.SmartFramework.System.UiTranslationBusinessEntity, Consultingwerk.SmartFramework.System.ValueListBusinessEntity, Consultingwerk.SmartFramework.Menu.MenuBusinessEntity, Consultingwerk.SmartFramework.Menu.MenuStyleBusinessEntity, Consultingwerk.SmartFramework.Menu.ModuleBusinessEntity, Consultingwerk.SmartFramework.Menu.ProductBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.AttributeBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.AttributeGroupBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.AttributeValueBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.ClassTypeBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.LinkTypeBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.ObjectTypeBusinessEntity, Consultingwerk.SmartFramework.Repository.Class.SupportedLinkBusinessEntity, Consultingwerk.SmartFramework.Repository.Customization.CustomizationBusinessEntity, Consultingwerk.SmartFramework.Repository.Customization.CustomizationTypeBusinessEntity, Consultingwerk.SmartFramework.Repository.Object.ObjectMasterBusinessEntity, Consultingwerk.SmartFramework.Scheduler.SchedulerJobBusinessEntity, Consultingwerk.SmartFramework.Scheduler.SchedulerJobPlanBusinessEntity
ABSTRACT

File:BusinessEntity
Purpose:Provides Access and Business Logik for a ProDataset
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Feb 24 22:22:37 CET 2010



Top Method Summary
Options Name Purpose
+ CanFind (dataset-handle, CanFindParameter) Returns a TRUE value if a record is found that meets the specified FIND criteria; otherwise it returns FALSE. CAN-FIND does not make the record available to the Business Entity or it's caller.
+ CountResultRecords (dataset-handle, ICountRecordsRequest) Counts the number of results of the query
# DestroyDataAccessObject () Unloads the DataAccess object
# FetchChildTableRecords (handle) Populates records in the child table identified by the buffer handle of the child table
+ FetchData (IFetchDataRequest) Fetch data from the Data Access object
+ F FetchData (IFetchDataRequest, dataset-handle) Fetch data and/or definitions
+ FetchDataByKeyTable (dataset-handle, IFetchDataByKeyTableParameter) Allows retrieve multiple DB records from a Business Entity based on a temp-table with key values
+ FetchDataset (dataset-handle) Creates and returns an empty dataset to the caller
+ GetBusinessEntityDescriptor (dataset-handle, GetBusinessEntityDescriptorParameter) Returns the Business Entity Descriptor for this Business Entity
+ GetTopNavBuffers (dataset-handle, CharacterHolder) Populates the provided CharacterHolder with a comma-delimited list of the names of the dataset TOP-NAV-BUFFER's
# InitializeDataAccessObject () Initializes the DataAcess Object
# LOGICAL PopulateFromPartialBuffer (handle) Populates a single ProDataset record from the partial record to the complete record
# PopulatePartialBuffer (handle) Populates a single ProDataset record from the partial record to the complete record
+ A ReceiveData () Provides a hook to modify data in the ProDataset after Read and Update operations (i.e. population of aggregated values)
+ SaveChanges () Saves changes using the DataAccess object
+ F SaveChanges (dataset-handle) Saves changes
+ F SaveChanges (dataset-handle, Object) Saves changes
+ SavePartialChanges (dataset-handle, Object) Saves partial changes to the Busiuness Entity Dataset
# CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, character) Builds a unique find predicate for a prodataset buffer (based on an unique index).
+ A ValidateData () Provides a hook for high level data validation before Update operations
+ ValidateData (dataset-handle, IValidateDataContext) Provides a client callable method for data validation
+ ValidatePartialData (dataset-handle, IValidateDataContext) Provides a client callable method for partial data validation

Top Constructor Summary
Options Name Purpose
+ BusinessEntity (handle) Constructor for the SmartBusinessEntity class

Top Property Summary
Options Name Purpose
+ CHARACTER ContextID A Context ID / Instance ID
+ CHARACTER DataAccessName Returns the name of the data access class used by this business entity
+ Consultingwerk.OERA.IDataAccess DataAccessObject Returns the reference to the data access object used by this business entity
+ HANDLE DatasetHandle Returns a reference to the dataset owned by this business entity
# Consultingwerk.OERA.IFetchDataRequest FetchDataRequest Returns the reference to the current IFetchDataRequest instance
+ Consultingwerk.OERA.Enum.RequestTypeEnum RequestType Returns the type of the current request (FetchData/SaveChanges)
# Progress.Lang.Object SaveChangesParameter Gets the reference of the current parameter object passed to the SaveChanges method
+ LOGICAL TrackingChanges Turns on and off tracking changes for the business entity temp-tables
# Consultingwerk.OERA.IValidateDataContext ValidateDataContext Returns the current IValidateDataContext instance


Method Detail
Top

PUBLIC CanFind (dataset-handle, CanFindParameter)

Purpose: Returns a TRUE value if a record is found that meets the specified
FIND criteria; otherwise it returns FALSE. CAN-FIND does not make
the record available to the Business Entity or it's caller.
Notes: Invokable method
Result will be assigned to the Result property of the CanFindParameter
instance

Parameters:
phDataset DATASET-HANDLE
Not used, do not pass in a DATASET or DATASET-HANDLE
poParameter Consultingwerk.OERA.CanFindParameter
The CanFindParameter with the parameters for this call
Top

PUBLIC CountResultRecords (dataset-handle, ICountRecordsRequest)

Purpose: Counts the number of results of the query
Notes: Used by the Generic JSDO Service to support the Count feature
Supports STOP-AFTER: When STOP-AFTER occurs, the StopAfterNumResults
value of the parameter object is returns as the Results
http://confluence.consultingwerkcloud.com/wiki/display/SCL/Generic+Service+Interface+for+JSDO+with+Kendo+UI+dialect#GenericServiceInterfaceforJSDOwithKendoUIdialect-ResourceCount

Parameters:
phDataset DATASET-HANDLE
The dataset handle (not used)
poParameter Consultingwerk.OERA.ICountRecordsRequest
The CharacterHolder to receive the list of TOP-NAV-BUFFERS
Top

PROTECTED DestroyDataAccessObject ()

Purpose: Unloads the DataAccess object
Notes:

Top

PROTECTED FetchChildTableRecords (handle)

Purpose: Populates records in the child table identified by the buffer handle
of the child table
Notes: Calls into a second instance of the Business Entity and performs a
FetchDataRequest based on the current record in the parent buffer
Performs no action, when the Child table record for the parent is
already available

Parameters:
phChildBuffer HANDLE
The child buffer
Top

PUBLIC FetchData (IFetchDataRequest)

Purpose: Fetch data from the Data Access object
Notes:

Parameters:
poFetchDataRequest Consultingwerk.OERA.IFetchDataRequest
The IFetchDataRequest object with the parameters for this call
Top

PUBLIC FetchData (IFetchDataRequest, dataset-handle)

Purpose: Fetch data and/or definitions
Notes:

Parameters:
poFetchDataRequest Consultingwerk.OERA.IFetchDataRequest
The IFetchDataRequest object with the parameter for this call
phDataset DATASET-HANDLE
OUTPUT Dataset with the resulting data
Top

PUBLIC FetchDataByKeyTable (dataset-handle, IFetchDataByKeyTableParameter)

Purpose: Allows retrieve multiple DB records from a Business Entity based on
a temp-table with key values
Notes: Proxy method to calling the same method in the data access class
SCL-647

Parameters:
phDataset DATASET-HANDLE
INPUT-OUTPUT DATAEST-HANDLE, only used for OUTPUT of the resulting dataset
poParameter Consultingwerk.OERA.IFetchDataByKeyTableParameter
The IFetchDataByKeyTableParameter with the data for this call
Top

PUBLIC FetchDataset (dataset-handle)

Purpose: Creates and returns an empty dataset to the caller
Notes: Useful for dynamic callers that need access to the dataset schema prior to calling FetchData

Parameters:
phDataset DATASET-HANDLE
OUTPUT Dataset with the resulting data
Top

PUBLIC GetBusinessEntityDescriptor (dataset-handle, GetBusinessEntityDescriptorParameter)

Purpose: Returns the Business Entity Descriptor for this Business Entity
Notes: Invokable Method
http://confluence.consultingwerkcloud.com/wiki/display/SCL/Business+Entity+Descriptor

Parameters:
phDataset DATASET-HANDLE
The dataset of the Business Entity
poParameter GetBusinessEntityDescriptorParameter
The GetBusinessEntityDescriptorParameter with the data for this call
Top

PUBLIC GetTopNavBuffers (dataset-handle, CharacterHolder)

Purpose: Populates the provided CharacterHolder with a comma-delimited list
of the names of the dataset TOP-NAV-BUFFER's
Notes:

Parameters:
phDataset DATASET-HANDLE
The dataset handle (not used)
poParameter Consultingwerk.CharacterHolder
The CharacterHolder to receive the list of TOP-NAV-BUFFERS
Top

PROTECTED InitializeDataAccessObject ()

Purpose: Initializes the DataAcess Object
Notes: Uses the DataAccessName property

Top

PROTECTED LOGICAL PopulateFromPartialBuffer (handle)

Purpose: Populates a single ProDataset record from the partial record to the complete
record
Notes: Used during SavePartialChanges and ValidatePartialData before SaveChanges
(for a single record) or ValidateData are called

Parameters:
phPartialBuffer HANDLE
The buffer of the partial dataset to use as the source
Returns LOGICAL
Logical value indicating if the operation was successful
Top

PROTECTED PopulatePartialBuffer (handle)

Purpose: Populates a single ProDataset record from the partial record to the complete
record
Notes: Used during SavePartialChanges and ValidatePartialData before SaveChanges
(for a single record) or ValidateData are called

Parameters:
phPartialBuffer HANDLE
The buffer of the partial dataset to use as the source
Top

PUBLIC ReceiveData ()

Purpose: Provides a hook to modify data in the ProDataset after Read and
Update operations (i.e. population of aggregated values)
Notes: Invoked during FetchData () and SaveChanges ()
Abstract method to be implemented by the actual Business Entity

Top

PUBLIC SaveChanges ()

Purpose: Saves changes using the DataAccess object
Notes: This method saves changes contained in the dataset currently present
in the Business Entity

Top

PUBLIC SaveChanges (dataset-handle)

Purpose: Saves changes
Notes: This method is called from consumers of the Business Entity and
receives the dataset. It calls into the SaveChanges() method with no
parameters after the internal dataset has been set
This method is called by the ServiceInterface when no parameter object
has been passed in

Parameters:
phDataset DATASET-HANDLE
INPUT-OUTPUT Dataset with changes
Top

PUBLIC SaveChanges (dataset-handle, Object)

Purpose: Saves changes
Notes: This method is called from consumers of the Business Entity and
receives the dataset. It calls into the SaveChanges() method with no
parameters after the internal dataset has been set
This method is called by the ServiceInterface when a parameter object
has been passed in. The parameter object will be accessible from within
the business entity using the protected property SaveChangesParameter

Parameters:
phDataset DATASET-HANDLE
INPUT-OUTPUT Dataset with changes
poParameter Progress.Lang.Object
Optional Parameter object for the SaveChanges method
Top

PUBLIC SavePartialChanges (dataset-handle, Object)

Purpose: Saves partial changes to the Busiuness Entity Dataset
Notes: Saves only those fields from the provided Dataset. Does fetch the
complete dataset first, then applies changes from the provided
dataset to the complete dataset and saves this using SaveChanges.
Relies on ROW-STATE in the partial dataset as well! A seperate method
may be added in the future, that only expects current values from the
passed in ProDataset
When multiple records are provided in the partial dataset, currently
each record is processed alone
For simplicity of the partial dataset, we do not expect this dataset to
have indexes defined. However, we do expect that the partial dataset
contains the columns of the primary unique key of the business entity
dataset columns
Flow of actions:
- Fetch the whole Dataset Records
- Manipulate the "before"
- Manipulate the "after"
- SaveChanges()
- Transfer ERROR, ERROR-STRING attributes
- Return updated partial records to the caller
SCL-987

Parameters:
phDataset DATASET-HANDLE
INPUT-OUTPUT Dataset with changes
poParameter Progress.Lang.Object
Optional Parameter object for the SavePartialChanges method (BusinessEntity:SaveChangesParameter)
Top

PROTECTED CHARACTER UniqueFindPredicateWithValueBuffer (handle, handle, character)

Purpose: Builds a unique find predicate for a prodataset buffer (based on an
unique index).
Notes: Based on BufferHelper:UniqueFindPredicateWithValueBuffer. Called from
SavePartialChanges. Extracted from SavePartialChanges to allow injecting
missing key field values (e.g. tenant related fields) by overriding
this method.

Parameters:
phBuffer HANDLE
The Business Entity ProDataset member buffer
phPartialBuffer HANDLE
The buffer of the partial dataset, values will be used from it's before-buffer
pcBufferName CHARACTER
The name of the buffer for the find string
Returns CHARACTER
The unique find predicate used to locate the ProDataset buffer for the partial update
Top

PUBLIC ValidateData ()

Purpose: Provides a hook for high level data validation before Update
operations
Notes: Invoked during SaveChanges (). When the ERROR flag of the ProDataset
is set, the Update operation will be cancelled before writing back
the data to the database using the DataAccess object
Abstract method to be implemented by the actual Business Entity

Top

PUBLIC ValidateData (dataset-handle, IValidateDataContext)

Purpose: Provides a client callable method for data validation
Notes: Invokes ValidateData(), but not linked to any SaveChanges invokation
The poContext parameter is available during the method execution through
the ValidateDataContext property
See SCL-1030

Parameters:
phDataset DATASET-HANDLE
The DATASET-HANDLE with the data to validate
poContext Consultingwerk.OERA.IValidateDataContext
The IValidateDataContext instance with the context for this call
Top

PUBLIC ValidatePartialData (dataset-handle, IValidateDataContext)

Purpose: Provides a client callable method for partial data validation
Notes: Invokes ValidateData(), but not linked to any SaveChanges invokation
The poContext parameter is available during the method execution through
the ValidateDataContext property
See SCL-1030, SCL-1034

Parameters:
phDataset DATASET-HANDLE
The DATASET-HANDLE with the data to validate
poContext Consultingwerk.OERA.IValidateDataContext
The IValidateDataContext instance with the context for this call


Constructor Detail
Top

PUBLIC BusinessEntity (handle)

Purpose: Constructor for the SmartBusinessEntity class
Notes:

Parameters:
phDataset HANDLE
The handle of the Business Entity Dataset (passed from the actual Business Entity)


Property Detail
Top

PUBLIC CHARACTER ContextID

Purpose: A Context ID / Instance ID
Notes: Used to differentiate multiple instances of the same Business Entity
Class

Returns CHARACTER
Top

PUBLIC CHARACTER DataAccessName

Purpose: Returns the name of the data access class used by this business
entity
Notes:

Returns CHARACTER
Top

PUBLIC Consultingwerk.OERA.IDataAccess DataAccessObject

Purpose: Returns the reference to the data access object used by this
business entity
Notes:

Returns Consultingwerk.OERA.IDataAccess
Top

PUBLIC HANDLE DatasetHandle

Purpose: Returns a reference to the dataset owned by this business entity
Notes:

Returns HANDLE
Top

PROTECTED Consultingwerk.OERA.IFetchDataRequest FetchDataRequest

Purpose: Returns the reference to the current IFetchDataRequest instance
Notes: Allows accessing the IFetchDataRequest instance during ProDataset
event call back and during the AttachDataSources method

Returns Consultingwerk.OERA.IFetchDataRequest
Top

PUBLIC Consultingwerk.OERA.Enum.RequestTypeEnum RequestType

Purpose: Returns the type of the current request (FetchData/SaveChanges)
Notes: Can be used in AttachDataSource etc. to adjust data sources for
optimized read or save operations

Returns Consultingwerk.OERA.Enum.RequestTypeEnum
Top

PROTECTED Progress.Lang.Object SaveChangesParameter

Purpose: Gets the reference of the current parameter object passed to the
SaveChanges method
Notes:

Returns Progress.Lang.Object
Top

PUBLIC LOGICAL TrackingChanges

Purpose: Turns on and off tracking changes for the business entity temp-tables
Notes: When assigning a value to this property, the TRACKING-CHANGES
attribute of all temp-tables will be set. When querying the
property, the value of the TRACKING-CHANGES attribute of the first
updatable temp-table will be returned. When there is not updatable
temp-table, FALSE will be returned

Returns LOGICAL
Top

PROTECTED Consultingwerk.OERA.IValidateDataContext ValidateDataContext

Purpose: Returns the current IValidateDataContext instance
Notes: Only valid while the ValidateDataContext (Dataset, IValidateDataContext)
method is executed, see SCL-1030

Returns Consultingwerk.OERA.IValidateDataContext


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:29:32