SystemSetup Generator

Describe your essential/project data once -- get the AbstractSystemSetup class, its initialization options, and the Spring bean to wire it up.

🔒 Your code never leaves your browser — everything is generated locally from templates, no AI, no server round-trip.

  • Class name is required.
PascalCase, e.g. LoyaltyCoreSystemSetup.Class name is required.
ImpEx files below will be imported from resources/trainingcore/import/general/.

ImpEx files to import

Setup parameters (HAC checkboxes)

Each parameter gates the ImpEx file at the same position above behind an isParameterEnabled(...) check.
trainingcore/src/com/prospect2p/core/setup/MySystemSetup.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.prospect2p.core.setup;

import de.hybris.platform.core.initialization.SystemSetup;
import de.hybris.platform.core.initialization.SystemSetupContext;
import de.hybris.platform.servicelayer.system.AbstractSystemSetup;

@SystemSetup(extension = "trainingcore")
public class MySystemSetup extends AbstractSystemSetup {

    @SystemSetup(type = SystemSetup.Type.ESSENTIAL, process = SystemSetup.Process.ALL)
    public void createData(final SystemSetupContext context) {
        // TODO: no ImpEx files configured -- add importImpexFile(context, "/trainingcore/import/general/<file>.impex"); calls here.
    }
}
Generated scaffold. Review and test before using in production.
Advertisement

What is a SystemSetup in SAP Commerce?

A SystemSetup class in SAP Commerce (de.hybris.platform.servicelayer.system.AbstractSystemSetup) is where an extension hooks into the platform's System Initialization and System Update steps in HAC -- importing essential/project ImpEx data and, optionally, exposing checkbox parameters on the HAC screen so an admin can choose what gets imported.

Methods are annotated with @SystemSetup(type=..., process=...) so the platform knows when to call them: ESSENTIAL vs PROJECT type, and INIT/UPDATE/ALL process.

When to use it

Use it for any ImpEx that needs to run automatically during system initialization or update rather than being imported by hand every time -- base/essential data, demo/sample data behind an opt-in checkbox, or project data that should be reapplied on every update.

Add setup parameters when you want an admin to be able to opt in/out of a chunk of data (e.g. sample data) from the HAC System Initialization/Update screen instead of always importing it.

Files generated

  • The SystemSetup class (<ClassName>.java) extending AbstractSystemSetup, with an @SystemSetup(type=..., process=...) annotated method calling importImpexFile(...) per configured ImpEx file.
  • A getInitializationOptions() override plus one @SystemSetupParameterMethod per configured setup parameter, if any are configured.
  • A Spring bean registering the class.

Step-by-step: how to use the output

  1. Copy the Java class into <extension>/src/<package>/setup/ and the Spring XML bean into your extension's -spring.xml (or merge the <bean> into an existing one).
  2. Place each referenced ImpEx file under resources/<extension>/import/<init|update|general>/<file>.impex -- the folder matches the process you picked (INIT -> init/, UPDATE -> update/, ALL -> general/), matching the paths the generated importImpexFile(...) calls use.
  3. Run System Initialization or System Update from HAC (Platform / Initialization) and confirm the ImpEx imports without errors in the log.
  4. If setup parameters were generated, check they appear as checkboxes on the HAC Initialization/Update screen and that unchecking one actually skips its linked ImpEx import.

Common mistakes

  • Putting the ImpEx file in the wrong folder relative to the importImpexFile(...) path -- the path passed to importImpexFile is relative to the extension's resources root (e.g. "/myext/import/init/data.impex"), not relative to the Java class.
  • Forgetting @SystemSetup(extension = "...") at the class level -- the platform uses it to associate the SystemSetup class with the owning extension in HAC.
  • Mixing up Type (ESSENTIAL/PROJECT) and Process (INIT/UPDATE/ALL) -- Type is about what kind of data it is, Process is about which lifecycle step(s) trigger it.
  • Assuming the exact SystemSetupParameter builder helper signature (createBoolean(...) and friends) is identical across every platform version -- it has drifted slightly between releases, so verify it against the target version before compiling against it blindly.

Frequently asked questions

What's the difference between ESSENTIAL and PROJECT type?

ESSENTIAL is meant for data the platform/extension cannot function without (reference data, base config); PROJECT is for project-specific data layered on top. Both are triggered the same way via process (INIT/UPDATE/ALL) -- the type is mainly a semantic/organizational distinction used by tooling and conventions.

What does process = ALL actually mean?

ALL means the method runs on both System Initialization and System Update, as opposed to INIT (first-time setup only) or UPDATE (every subsequent update run).

Why wrap importImpexFile in isParameterEnabled checks?

So an admin can opt specific chunks of data in/out from the HAC System Initialization/Update screen -- e.g. skip importing large sample/demo data in a production environment while still importing it in a dev environment.

Where should the ImpEx files actually live?

Under resources/<extension>/import/, conventionally split into subfolders per process (init/, update/) or a general/ folder for ALL -- matching the path string passed to importImpexFile(context, "/<ext>/import/...") in the generated Java.

Is createBoolean(...) the exact real method signature?

It's the most commonly documented form for building a boolean SystemSetupParameter, but the helper has varied slightly across platform versions -- double-check it against the de.hybris.platform.core.initialization.SystemSetup API docs/sources for your exact SAP Commerce version before relying on it.

🗳️ Vote for the next SAP Commerce guide

Vote or suggest a topic
What should we write next? Vote