2Pack/RuleElementHandler

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Background

  • This is part of the OSGI HengSin/2Pack module that is resolved during OSGI HengSin/Issues.
  • It is also reported in the Trunk Bug Tracker.
  • The model changes submitted are applicable in both Trunk and OSGI HengSin. However the code changes are adapted for the OSGI project first. To apply to the Trunk will need a small adapting back to the legacy HandleRegistry in the Trunk.
The PackOut Details Tab added with Rule type to get the Rule record

Modifcations

  • As reported in kenai tracker i submitted some changes:
    • Add Rule as Type in PackOut Export Detail which resulted in DB change migration scripts for both oracle and PG.
    • Add Setter/Getter of new columns for AD_Rule in AD_Package_Exp_Detail done by running GenerateModel.java.
    • Created a new RuleElementHandling.java adapted from DynValRuleElementHandler.
  • The necessary changes to capture this new element resulted in some changes to other classes as submitted in the tracker there.
    • PackOutProcess
    • MPackageExpDetail

Successful Testing

  • I successfully PackOut a Rule and then PackIn again.
  • This is the PackOut.xml that proves the RuleElementHandler didn't screw up.
<?xml version="1.0" encoding="ISO-8859-1"?>
<adempiereAD Name="Rule" Version="1" AdempiereVersion="all" DataBaseVersion="1" 
Description="Testing Rule Model in PackageExport" Author="1" AuthorEmail="1" 
CreatedDate="2011-01-02 09:11:42.0" UpdatedDate="2011-01-02 09:11:42.0" 
PackOutVersion="100" Client="0-SYSTEM-System">
    <AD_Rule type="table">
        <AD_Org_ID>0</AD_Org_ID>
        <AD_Rule_UU>af325f6a-c984-4f4a-86c4-212f619b7cb1</AD_Rule_UU>
        <AccessLevel/>
        <Description/>
        <EntityType>U</EntityType>
        <EventType>C</EventType>
        <Help/>
        <IsActive>true</IsActive>
        <Name>Booking_Details</Name>
        <RuleType>Q</RuleType>
        <Script>Select * from IS_Schedule is where is.Origin = @Origin@ 
and is.destination = @Destination*</Script>
        <Value>beanshell:Booking_Details</Value>
    </AD_Rule>
</adempiereAD>
  • The following are images from the test.
The PackIn recorded a whopping success
The detail of the PackIn
This is the guinea pig used in the experiment