Documentation for a newer release is available. View Latest

How Do I Build a Model Domain Class?

When your DSL is generated, a Builder is provided by the domain class, which allows for the provision of everything the domain needs to function.

The minimum requirements for constructing the domain using this Builder are:

  • The actor system for the domain to run on

  • Implementations of all the generated interfaces/ports (external domains, domain functions & decisions)

An example of how a simple domain may be built is provided below:

 new XYZDomain.Builder(actorSystem)
                .withDomainFunctionAdapter(new SampleXYZDomainFunctionAdapter())
                .withDecisionAdapter(new SampleXYZDecisionAdapter())
                .withABCFlowAggregateFunctionAdapter(new SampleABCFlowAggregateFunctionAdapter())
                .withAnExternalDomainActionAdapter(new SampleExternalDomainActionAdapter())
                .build();

When the build method is invoked, all the flows within the model will be started.

When a new application is built using the IPF Scaffolder, domain generation is automatically invoked and defaulted into the <ABC>DomainConfig class (where <ABC> is the model name).