Customizing Compiere Source

Compiere erp software comes with tested and stable Core Classes and if we intend to make changes on Compiere Core Model Objects, then please know that we’re drifting the software into dark murky waters…

Either be it a simple single line of code or a big chunk of copy pasted boilerplate, Once we take that decision, there’s no going back. The behavior of the entire workflow will be affected in all possible ways. Hours and days of repeated testing and fixes will become a daily routine and finally unavoidable…

To avoid these kind of issues, we must resort to using the compiere’s Application dictionary, process calls and workflow events. The customized code blocks should be maintained as portable plugins which can be placed in the classpaths and when available, they run the exclusive code to that particular process. and these portable plugins will have entrypoints defined in them which can be called upon whenever we configure them to be called on a specific workflow like invoice generation, new order creation and so on…

This example should shed some light over these concepts

If we need to generate invoices automatically after completing a sales order, we could change some AD entries related to “C_Order Process” which is bound to the “Complete” button in sales order screen. Zooming across the workflow associated with the “C_Order Process” process and creating a node entry(Action=>”Apps Process”, Process=>”Invoice generation Process”) and associating the invoice generation process and then link the node to the last node’s transition entry

Step 1)

Search for “workflow editor” then in the “workflow editor” window, search for “Process_Order”

Step 2)

Now “left click” on the white area, you’ll notice a strip to create a new node. Click on it and give the node a name eg: “AutoInv”

Step 3)

Now click the down arrow to bring up the transition list. select “Add Line : (DocComplete) -> AutoInv”

Step 4)

Save the Workflow

Step 5)

Select the node “AutoInv” and ZoomAcross… Now, the Node entry gets opened up for more detailed edit. Select “Apps Process” in the Action field and “C_Invoice_Generate” in the Process field and save the node.

The three Main advantages of customizing the compiere ERP in a “plug and play” approach is to reduce major headaches during compiere version upgrades, deployment and Source control