Task App - Add Task
Bounded Context
Log in to the Codebricks Platform. Follow the instructions to create a Business Domain and a Bounded Context.
Open the Bounded Context and start planning the Task App.
Task Aggregate
- Click the Aggregate menu button on the left side of the screen.
Open the add Aggregate sub menu
- Click the add button to open the sub menu.
- Type in 'task'.
- Click 'save' to create the new Aggregate.
Add Task
Select the Use Case type Command API (CA)
- After selecting an aggregate, click the Use Case Command API (CA).
- Your cursor turns into the CA icon.
- Click on the Plan to place the Command API.
- The Command API Use Case will then appear on the Plan.
Command API Use Case placed on the Plan
Select the added Command API (CA) Use Case
- Click the added Command API (CA) Use Case.
Command API with open sub elements view
API Request
Change the API Request name
- Click the name input of the API Request.
- Type in 'add task'.
- Confirm the new name by clicking on 'save'.
- Click the plus icon on the right.
- Type 'title' in the name input.
- Select 'string' in the type dropdown.
- Click the ✓ to save the property.
- Click the plus icon on the right.
- Type 'description' in the name input.
- Select 'string' in the type dropdown.
- Click the ✓ to save the property.
- Click the plus icon on the right.
- Type 'assignee id' in the name input.
- Select 'uuid' in the type dropdown.
- Click the ✓ to save the property.
API Request with changed name and new properties
Command
Copy properties to Command
- Click the 'copy to command' button on the API Request.
- The 3 properties appear in the Command.
- Click the name input of the Command.
- Type 'add task'.
- Confirm the new name by clicking on 'save'.
Add Value Object to the 'title' property
- Click the edit icon on the right of the 'title' attribute.
Create a new Value Object
- Click the plus button next to the dropdown 'value object'.
Create the 'title' Value Object
- Type the Value Object name, 'title', in the name input of the sub menu.
- Press the ✓ icon of the add value object sub menu to create the Value Object.
- Make sure the new created Value Object is selected.
- Press the ✓ icon to save the change to the title property.
- Repeat Steps 3, 4 and 5 for the 'description' and 'assignee id' properties.
Command with changed name, new properties and value objects
Aggregate Method
Copy properties to Aggregate Method
- Click the 'copy to method' button on the Command.
- The 3 properties appear in the Aggregate Method.
Keep the Aggregate Load Type
- The execution of the 'add task' Command creates a new 'task' Aggregate.
- Keep the selection 'create' for the Aggregate Load Type.
Aggregate Method with copied properties and Aggregate Load Type 'create'
Event
- Click the 'copy to event' button on the Aggregate Method.
- The 3 properties appear in the Event.
- Click the name input of the Event.
- Type in 'task added'.
- Confirm the new name by clicking on 'save'.
Event with copied properties and new name
Aggregate State
Add task status to the Aggregate State
- Click the plus icon on the right.
- Type 'task' in the name input.
- Select 'enum' in the type dropdown.
Create the 'task status' Enum
- Click the plus next to the 'enum' dropdown.
- Type 'task status' in the name input of the Enum sub menu.
Create the 'task status' Enum
- Type 'open' value input and click the plus right next to the input.
- Type 'completed' value input and click the plus right next to the input.
- Type 'closed' value input and click the plus right next to the input.
- Click the ✓ button on the right to create the enum.
Save the 'task status' property
- Ensure the new created 'task status' enum is selected as enum for the 'task status' property.
- Click the ✓ button on the right to create the property.
Set the Value Source for the 'task status' Aggregate State property
- Click the plus button on the right of the 'task status' property.
Set the Value Source for the 'task status' Aggregate State property
- Select the Value Source type 'Static'.
Set 'open' as Static Value Source for the 'task status' Aggregate State property
- Select the Value Source value 'open'.
- Click the ✓ button on the right.
Aggregate State with task status property and static Value Source
API Response
Add task id to the API Response
- Click the plus icon on the right.
- Type 'task id' in the name input.
- Select 'uuid' in the type dropdown.
- Click the ✓ button on the right.
Set the Value Source for the 'task id' API Response property
- Click the plus button on the right of the 'task id' property.
Set the Value Source for the 'task id' API Response property
- Select the Value Source type 'Metadata'.
Set 'task.aggregate id: uuid' as Metadata Value Source for the 'task id' property
- Select the Value Source value 'open'.
- Click the ✓ button on the right.
API Response with task id property and metadata Value Source
Set Add Task Ready
Select 'add task' Use Case
- Click the 'add task' Use Case.
- Click the Use Case menu icon on the left side.
Set generation status to ready
- Set the generation status from 'planned' to 'ready'.
Planned Use Cases have a blue border, the Code Generator wont generate its code.
Ready Use Cases have a gray border, the Code Generator generates its code.
Use case is ready for Code Generation
Setup Code Generation
Open the Code Generator menu
- Click on the 'Code' button on the top right corner to open the Code Generator menu.
- Click the 'Download' Button for Mac or Linux or Windows.
Code Client MacOS
Install Code Client on Mac
- Drag and drop the Codebricks Code Client into Applications.
- Open the Applications folder.
- Open the Codebricks Code Client.
Code Client Linux
Install Code Client on Linux
- Run `sudo apt-get install ./codebricks-codeclient.deb`
- Open the Applications.
- Open the Codebricks Code Client.
- Or run `./codebricks-codeclient`
Code Client Windows
Install Code Client on Windows
- Open the `codebricks-codeclient.exe`.
- Open the Applications folder.
- Or go to your Desktop.
- Open the Codebricks Code Client.
Open the Code Generator menu
- Click on the 'Code' button to open the Code Generator menu.
- Click the 'Login' button.
- The browser may ask for confirmation to open the Code Client.
- The Code Client will show 'Login was successful'.
The Code Client is connected
Select Aggregates and Path
- Open the browser again and select the 'task' Aggregate.
- Click the 'Configure Code Path' button.
- The browser may ask for confirmation to open the Code Client.
Set the Code Path in the Client
- Click the 'Set Path' button.
- Select a directory for the Code project.
- Click the 'Done' button.
Code generation is configured
Generate the Code
Open the Code Generator menu
- Click on the 'Code' button to open the Code Generator menu.
- Click the 'Generate Code' button.
- Wait until the activity indicator disappears and 'Code Generation done' is displayed under the button.
- Open the selected Path with an IDE or Text Editor.