Task App - Complete Task

Complete Task

1
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.
2
Place the Command API
  • 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

Use Case Sub Menu

1
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

1
Change the API Request name
  • Click the name input of the API Request.
  • Type in 'complete task'.
  • Confirm the new name by clicking on 'save'.
2
Add 'task id' property
  • Click the plus icon on the right.
  • Type 'task 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

1
Copy properties to Command
  • Click the 'copy to command' button on the API Request.
  • The property appears in the Command.
2
Change the Command name
  • Click the name input of the Command.
  • Type 'complete task'.
  • Confirm the new name by clicking on 'save'.
3
Add Value Object to the 'task id' property
  • Click the edit icon on the right of the 'task id' attribute.
4
Create a new Value Object
  • Click the plus button next to the dropdown 'value object'.
5
Create the 'task id' Value Object
  • Type the Value Object name, 'task id', 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 task id property.

Command with changed name, new property and value object

Aggregate Method

1
Set the Aggregate Load Type
  • The execution of the 'complete task' Command loads an existing 'task' Aggregate.
  • Select 'load' for the Aggregate Load Type.
2
Add Aggregate Load Condition
  • Click plus to add the condition
3
Select a Value Source
  • Select the 'complete task.task id' property of the Command as Value Source.
Only properties of the type UUID are valid Value Sources for the Aggregate Load Condition

Aggregate Method with Aggregate Load Type and Aggregate Load Condition

Event

1
Change the Event name
  • Click the name input of the Event.
  • Type in 'task completed'.
  • Confirm the new name by clicking on 'save'.

Event with copied properties and new name

Aggregate State

1
Set the Value Source for the 'task status' Aggregate State property
  • Click the plus button on the right of the 'task status' property.
2
Set the Value Source for the 'task status' Aggregate State property
  • Select the Value Source type 'Static'.
3
Set 'completed' as Static Value Source for the 'task status' Aggregate State property
  • Select the Value Source value 'completed'.
  • Click the ✓ button on the right.

Aggregate State with task status property and static Value Source

API Response

Keep the API Response as it is

Set Complete Task Ready

1
Select 'complete task' Use Case
  • Click the 'complete task' Use Case.
2
Open the Use Case menu
  • Click the Use Case menu icon on left side.
3
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.

The two Use Cases are ready for Code Generation

Generate the Code

1
Open the Code Generator menu
  • Click on the 'Code' button to open the Code Generator menu.
2
Start Code Generation
  • Click the 'Generate Code' button.
3
Generating code
  • 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.

The generated code

Next
Task Overview

© 2024 Codebricks | All rights reserved.