PFC Guide Titlebar
HomeFAQLinksPFCMAGExtensionsDownloadWhat's NewSearch

Pipeline Extension

Ver. 1.00
Contributed by Savoulidis Iordanis



What


Why

 

Generally, the pipeline object works with only one transaction pair and only one pipeline object. I tried to give the programmer the ability to overcome this, with some kind of black box solution. You might think of this user object, as a medium for replicating data across databases !

 

How

 

First of all here are the benefits of the user object:

 

THE IMPLEMENTATION

Note: All scripts use the PFC N_TR transaction object, and all controls on the window, must be PFC controls.

- Inherited from PFC_N_PL user oject.

- Added some instance variables:

- Added the following USER EVENTS (some of them provide arguments. Don't miss them):

These events are executed from inside the uo functions and the programmer can extend them, to provide response from the uo to the user (eg. log the action in a file as in the example provided, etc).

- Added the following FUNCTIONS:

 

SAMPLE USAGE

<Open event of a window>
// declares the arrays of pictures to be animated, and pipe objects to be set in the // transaction pairs
string ls_bmps[] = {"trans00.bmp","trans01.bmp","trans02.bmp","trans03.bmp","trans04.bmp"}
string ls_pipes1[] = {"p_1","p_2","p_3"}
string ls_pipes2[] = {"p_1","p_2"}

 

// create the transaction objects to be registered in pairs inside the new pipeline object
itr_source1 = CREATE n_tr
itr_source1.DBMS = "ODBC"
itr_source1.DBParm = "ConnectString='DSN=Powersoft Demo DB V6;UID=dba;PWD=sql'"
itr_source1.of_SetName("PSDEMODB1")
itr_source2 = CREATE n_tr
itr_source2.DBMS = "ODBC"
itr_source2.DBParm = "ConnectString='DSN=Powersoft Demo DB V6;UID=dba;PWD=sql'"
itr_source2.of_SetName("PSDEMODB2")
itr_target1 = CREATE n_tr
itr_target1.DBMS = "ODBC"
itr_target1.DBParm = "ConnectString='DSN=SQL Anywhere 5.0 Sample;UID=dba;PWD=sql'"
itr_target1.of_SetName("SQL Anywhere 5.0 Sample 1")
itr_target2 = CREATE n_tr
itr_target2.DBMS = "ODBC"
itr_target2.DBParm = "ConnectString='DSN=SQL Anywhere 5.0 Sample;UID=dba;PWD=sql'"
itr_target2.of_SetName("SQL Anywhere 5.0 Sample 2")

 

// Create the object (n_pipeline_sample is inherited from the N_PIPELINE I provide)
inv_pipeline = CREATE n_pipeline_sample

 

// Optional. Sets the array of picture frames for animations
inv_pipeline.of_SetBmp(ls_bmps)

 

// Optional (but better exist). Sets the controls for user interaction. Explained by position: 
// U_ST controls to display source/target transactions, rows read, rows written, 
// rows in error, status bar,
// U_CB controls to start, stop, repair, skip transfer, skip pipeline,
// U_P control for the animation, 
// U_DW control for displaying the errors
inv_pipeline.of_SetFeedback(st_source, st_target, st_read,st_written,st_inerror,st_status, &
cb_start,cb_stop,cb_pause,cb_repair, cb_skip_transfer, cb_skip_pipeline, &
p_animate, &
dw_errors)

 

// basic code needed
inv_pipeline.of_Register(itr_source1, itr_target1, ls_pipes1)
inv_pipeline.of_Register(itr_source1, itr_target2, ls_pipes2)
inv_pipeline.of_Register(itr_source2, itr_target2, ls_pipes2)

 

<clicked event for start button> <clicked event for stop button>
inv_pipeline.of_Start() inv_pipeline.of_Stop()

 

<clicked event for pause button> <clicked event for Skip transfer button>
inv_pipeline.of_Pause() inv_pipeline.of_SkipTransfer()

 

<clicked event for repair button> <clicked event for Skip pipe button>
inv_pipeline.of_Repair() inv_pipeline.of_SkipPipe()

 

The object functions, handle the enabling/disabling of the controls at the right moment, to prevent errors from user interaction In conclusion, the programmer must inherit from the N_PIPELINE uo, instead of the N_PL.

Also, DO NOT use the pipeline's pipeend event from now on. Use the pfc_pipeend event instead.

 


Download the   About the extension contributor

 

Revision History
10/27/1998 Initial Revision Ver. 1.00

Interested in contributing material to this web site? Send an email to submit@pfcguide.com, but don't forget to check the contribution guidelines first.


For information or suggestions about this web site please contact webmaster@pfcguide.com

PFCGuide is sponsored by Dynamic Technology Group.
The information on this site is provided for advice only and not to be considered a contract or a liability against Dynamic Technology Group.

Last Revised: February 15, 2004 03:58 AM.