PDA

View Full Version : Deferred BusinessProcess { ComponentType=BPClass }



raveens
24-Jun-2018, 10:31 PM
Hi DAW,

With reference to:
https://support.dataaccess.com/Forums/showthread.php?62104-Deferred-BusinessProcess&p=330029#post330029

Is there any chance of updating the { ComponentType=BPClass } to allow for deferred objects in DF19.1? Currently, we're overwritting the component type of our BusinessProcess class to use VWClass instead as it allowes for deferred views/objects, please see below:



{ ComponentType=VWClass }
Class cBusinessProcess is a BusinessProcess
Procedure Activate_View
Send DoProcess
End_Procedure
End_Class


The above works very well (besides the hack), as it allows Business Processes to be independently declared (outside the view) and only initiated once, rather than mutiple times within views.

Please note that, 98% of the work is already done, as deferred code generation is already being done by the studio.

The following is already automatically gerenerated by Studio ( as it thinks the BP is a view ) when you set "Deferred Object"="true" within the property pane



Deferred_View Activate_oMyBusinessProcess for ;
Object oMyBusinessProcess is a cBusinessProcess
Cd_End_Object


Suggested additions to the Studio BPClass component tag:



Allow for "Deferred Object" and "Access name" (just like views VWClass)
Use "Deferred_Object" command instead of "Deferred_View" when generating deferred code and access name, Note: internally Deferred_Object=Deferred_View therefore its more cosmetic.


And obviously, an extra procedure within standard BusinessProcess class called "Activate_View" to call "DoProcess"

Calling the BusinessProcess couldn't be simpler



Send Activate_oMyBusinessProcess

// or, Alternatively
// Get Activate_oMyBusinessProcess_Handle to hoBP
// If (hoBP) Send DoProcess of hoBP


Thanks

Peter Bragg
25-Jun-2018, 02:54 AM
Calling the BusinessProcess couldn't be simpler



Send Activate_oMyBusinessProcess

// or, Alternatively
// Get Activate_oMyBusinessProcess_Handle to hoBP
// If (hoBP) Send DoProcess of hoBP





I like the idea, but personally I prefer the latter of your two approaches/suggestions, because it gives the opportunity to set properties of the process object between it being created and DoProcess being called.

Dennis Piccioni
25-Jun-2018, 07:39 AM
Hi Raveen,

I made sure the suggestion is logged.