Create a Business Process class with the basics for handling
remote data updates and refreshes. This makes no assumptions about
how the data is obtained. The procedures do that here are stubbed out and
must be provided in a sub-class.
Construct_Object()
- Handle
Main_DD - Integer
pbShowEntryErrorwhen moving data from remote object to DD buffer should
we display or ignore errors (like bad dates and numbers)
- Boolean
pbClearDDOsOnDetachthis adds an extra layer of safety with process pooling. It is disabled
to get maximum speed and because it is usually not needed. Prior to
vdf10, this property did not exist and the clear always happened.
set(Handle hDD)
With the merge of VDF and WebApp, we need to support main_dd as this
is the property that the IDE uses. Older webApp may use this
- handle
phMainDD()
ReportAllErrors(string sHdr)
*************************************************************************
*** Abstract Interace. Sub-classes or objects must provide augmentations
to perform the following functions. When the ISO layer is added these
messages will be augmented to provide functionality.
*************************************************************************
ReportLastError(Integer bClearError)
ClearErrors()
- Integer
ErrorCount()
ReportErrorItem()
ErrorQueueStart()
ErrorQueueEnd()
RequestFileRecords()
RequestFileFieldValues()
LogEvent(Integer iEventType String lpszEvent)
We need this so we can redirect specific errors to the Administrator event log
- integer
Search_File_Name(string sFileName)
*************************************************************************
*** Low Level Support interface.
*************************************************************************
At this level we simply assume a one to one translation. That we are passed
a file and field number. Sub-classes can do their own tricky translation by
augmenting these two functions
- integer
Search_Field_Name(integer iFile string sFieldName)
- integer
MapToFileNumber(string sFileName string sFieldName)
Pass FileName and return FileNumber. Ret 0 if error
good for augmentation
- Integer
iFile
- Integer
MapToFieldNumber(Integer iFile String sFieldName)
good for augmentation
- Integer
iField
- integer
MapFileNameToDD(string sFilename integer bCanUseMain)
Pass filename and return the DD that owns the file. If filename is blank and
bCanUseMain is true, use the Main_dd. return 0, if no file
This will report all errors it encounters.
- Integer
iFile - Integer
hMainDD - Integer
hDD - Integer
bErr
- integer
RequestUpdateRecords(integer hDD)
Refind all records. Pass: DD that controls the operation
Return: True if error occurred.
The updates both rowids and recnums. We assume that you'd never mix these. The
recnum update is provided for backwards compatibility and only works on recnum tables. Use RowIds!
Record Ids are passed from the OCX.
This assumes that there are no errors when this is started!!!!
- Integer
RequestUpdateFileFieldValues(integer hDD)
ReSynch all data
This assumes that there are no errors when this is started!!!!
- Integer
hOldMain
- integer
RequestUpdateData(integer hDD)
Update all Data from Entry-object to DD Buffer
First refind all existing records, Then update all changed values
Returns: zero if no error.
- Integer
bErr - Integer
hMain
OnDetachProcess()
JJT: DoSetFileRecordId and DoSetFilrRowId moved to cIneternetSessionBusinessProcess . DoSetFileFieldValue was already there
// These two messages are sent by the Remote DEO (e.g. the OCX) that is
// is processing a request to update Record values or file/field values.
// They returns Err if the operation failed
//
// Move Passed Value for fieldname fieldname to the appropriate DD.
// The remote object should send this message in response to
// RequestFileFieldValues
//
Procedure DoSetFileFieldValue String sFile String sField String sValue
Integer iField iFile
Handle hMain hDD
Get Main_dd to hMain
If hMain eq 0 Procedure_Return // error should already be declared
Get MaptoFileNumber sFile sField To iFile // also return (ERR)
if (iFile > 0) ;
Get MaptoFieldNumber iFile sField To iField
// We send this to Main-DD. This allows us to support Foreign field logic
If (iFile>0 AND iField>=0) begin
Get data_set Of hMain iFile To hDD
If (hDD=0) Begin
Send LogErrorEvent DFERR_WEBAPP_DDO_NOT_FOUND_FOR_FILE (SFormat(C_$CouldNotFindDDForFileName, sFile))
End
Else Begin
Set File_Field_Entry of hMain iFile iField (pbShowEntryError(self)) to sValue
End
end
Indicate Err as (iFile=0 OR iField<0 OR hDD=0) // set error indicator
End_Procedure
// Move Passed record num for fieldname to the appropriate DD.
// The remote object should send this message in response to
// RequestSetFileRecords
//
// We expect that this message is sent by the Client (OCX) passing a
// filename and file number (we call it ID so we can move away from recnums).
// Sets Err if error occurs
Procedure DoSetFileRecordId string sFileName string sRecordId
integer hDD
Get MapFileNametoDD sFileName False to hDD // Must find the file
If hDD ;
Set Find_record_id of hDD to (integer(sRecordID))
Indicate Err as (hDD=0) // set error indicator
End_procedure
Procedure DoSetFileRowId string sFileName string sRowId
integer hDD
Get MapFileNametoDD sFileName False to hDD // Must find the file
If hDD ;
Set Find_RowId of hDD to (DeserializeRowId(sRowId))
Indicate Err as (hDD=0) // set error indicator
End_procedure
DoClearDDOs()
- Integer
hMainDD
DoDetachProcess()
- Boolean
bClearDDOsOnDetach
OnAttachProcess()
DoAttachProcess()