alpha360 BPs
BPs or Business Processes are alpha360s' procedures that handle adds, modifies, deletes, posts etc for the various data entities.
- They can handle complex or simple entities
- When they affect complex entities, they are always inside a "transaction" and come as "pairs"
- They use variables - simple variables, record structures or arrays - as parameters
- They return an error message, through o NON local parameter string, usually named p_sErrorMessage
- They may return the PK of a record that was added, through o NON local parameter string, usually named p_sReturnPK
- They return a TRUE or FALSE
all BPs are heavily documented inside the projects, but to get a better understanding, we are going to give a detail explanation of one of them.
BP_Product_add()
This BP adds Product Entities to the database - everything is done in a transaction, with 2 BPs ...
Call
BP_Product_add(
LOCAL p_R_gProduct is Record of gProduct,
LOCAL p_sImageFile is string,
LOCAL p_sUserPK is string,
p_sReturnPK is string,
p_sErrorMessage is string)
Flow
Run BP_Product_add()
- This starts a transaction and calls BP_Product_add_private(), passing to it, the same parameters it received.
- BP_Product_add_private() returns TRUE or FALSE, and triggers the COMMIT or ROLLBACK of the transaction, inside BP_Product_add().
Note that the 2 "paired" procedures have the same parameter list and their names are distinguished by a _private at the end.
Return
TRUE or FALSE
Other Data Returned
- p_sReturnPK - see the call - returns the PK of the Product Entity, if the add was successful
- p_sErrorMessage - see the call - returns the error, if the add was not successful
CODE Bricks [new in v2]
Code Bricks are special WX procedures, used to make WX coding simple and easier to follow.
They have NO CRUDE functionality AND they just assign values to record variables.
You can find them at BP_CodeBricks
alpha360 CRUDE functions
Instead of using the classic WL HAdd(), HModify(), HDelete() functions, alpha360 projects use the following functions: alpha360_Add, alpha360_Modify and alpha360_Delete.
These functions include error reporting and trigger functionality.
See the code for more information ...