Automatic External Pack In
This feature allows 2Pack files to be installed automatically at server startup from an external folder—without requiring them to be embedded in a plug-in.
Background
iDempiere supports several ways to install 2Packs from within plug-ins:
AdempiereActivator: InstallsMETA-INF/2Pack.zipVersion2PackActivator: Installs multiple filesMETA-INF/2Pack_[version].zipup to the plug-in versionIncremental2PackActivator: Installs allMETA-INF/2Pack_[version].zipfiles regardless of plug-in version
Limitations of these approaches:
- Only work when a plug-in is present
- Only install data on the System client
Automatic External Pack In
To overcome the limitations above, the Automatic External Pack In mechanism was introduced.
Automatic on Server Restart
This is driven by several SysConfig keys:
| Key | Description |
|---|---|
AUTOMATIC_PACKIN_FOLDERS | Folder(s) to scan for .zip files (semicolon ; separated) |
AUTOMATIC_PACKIN_INITIAL_DELAY | Time in seconds that org.adempiere.plugin.utils waits before starting to process the AUTOMATIC_PACKIN_FOLDERS, this is useful in order to wait for the internal plugins to be processed first |
AUTOMATIC_PACKIN_RETRIES | When applying automatically a 2Pack, this defines the number of retries to wait for the semaphore when other plugins are applying 2Packs, this is used in combination with AUTOMATIC_PACKIN_TIMEOUT |
AUTOMATIC_PACKIN_TIMEOUT | When applying automatically a 2Pack, this defines the waiting time to try to get the semaphore when other plugins are applying 2packs, this is used in combination with AUTOMATIC_PACKIN_RETRIES |
AUTOMATIC_PACKIN_PROCESSING | This key is used internally by the automatic application of 2Packs as a semaphore to indicate that another 2Pack is being applied, is not intended to be managed by the user, but automatically managed by the system. |
ZIP File Naming Convention
Files must follow this naming pattern:
[Timestamp]_[ClientValue]_[OptionalInfo].zip
Naming Components
| Component | Description | Format |
|---|---|---|
| Timestamp | Used to sort files chronologically | yyyymmddHHMM |
| ClientValue | Target client(s) for installation | See options below |
| OptionalInfo | Human-readable description | Any descriptive text |
ClientValue Options
The ClientValue component determines which client(s) will receive the 2Pack installation:
| ClientValue | Behavior | Example |
|---|---|---|
SYSTEM | Install only on System client | SYSTEM |
[ClientName] | Install only on specific client | GardenWorld |
ALL-CLIENTS | Install on all non-System clients | ALL-CLIENTS |
ALL-CLIENTS-[SeedClient] | Install on seed client first, then all others | ALL-CLIENTS-GardenWorld |
- Use
ALL-CLIENTSwhen you want identical configurations across all tenants - Use
ALL-CLIENTS-[SeedClient]when you need to establish UUID mappings for cross-client record references
Examples
201803161725_SYSTEM_CreateNewColumn.zip→ Installs on System201803161735_GardenWorld_CreateNewTax.zip→ Just GardenWorld201803161745_ALL-CLIENTS_CreateNewTax.zip→ All non-System clients201803161755_ALL-CLIENTS-GardenWorld_CreateNewTax.zip→ GardenWorld first, then others
Seed Client Explained
When installing in ALL-CLIENTS, the seed client creates a UUID map. This allows:
- Creating identical records across tenants
- Updating records in other clients that originated in the seed client
The mapping is stored in the AD_Package_UUID_Map table.
Flow Summary
- Scans folders recursively for
.zipfiles - Sorts files by timestamp
- For each zip file:
- Determines target client(s)
- Installs into each tenant
- Logs result in the Pack In window
- Stops on error; remaining files will not be applied
Email Notifications
To receive success/failure notifications:
- Configure email settings on each tenant (Request EMail must be valid)
- Set the
EMAIL_NOTIFY_2PACKSysConfig key with one or more emails (comma-separated)
Emails are sent per tenant and also for System if applicable.