Skip to content

pousse-cafe/pousse-cafe-sample-app

Repository files navigation

My Application

This is a simple Pousse-Café application defining a single module (MyModule).

Add a process

The samples directory contains an example of process described using the EMIL language. The code for that process can be generated by executing the following command:

mvn compile pousse-cafe:import-process -DemilFile=samples/MyProcess.emil

All required classes and methods are then generated and you just have to fill in the gaps.

Execute grep -R TODO * command in order to locate the missing parts (comments starting with TODO have to be replaced by actual code).

Update or create a process without input file

Execute the following goal command:

mvn compile pousse-cafe:validate pousse-cafe:update-process -DprocessName=MyProcess

This will compile, validate, then open an editor showing the EMIL description of a given process. If the process does not exist, an empty process is displayed.

Add event productions and/or consumptions. For example, you may replace

AnotherDomainEvent! -> Ru{DoSomethingElseRunner}
    @MyAggregate.Root[doSomething]

with

AnotherDomainEvent! -> Ru{DoSomethingElseRunner}
    @MyAggregate.Root[doSomething]:
        :Event1! -> .
        :.

which means that upon execution of listener doSomething, the event Event1 is issued.

Save and exit, the missing classes and/or methods are then created. You can have a look at MyAggregate.java file, you'll see that annotation @ProducesEvent(Event1.class) has been added on method doSomething. Also, classes Event1 and Event1Data have been created.

Generate documentation

Run the following command:

mvn pousse-cafe:generate-doc

The folder target/ddd-doc/ now contains documentation (HTML and PDF) describing your model.