Commands

Commands are used to either create a new instance or manipulate an already existing instance of a root entity. While modelling, commands can only be created within a root entity.

Command types

Solution Designer provides two different command types for root entities:

  • Factory Command: This type of command will be used to create new instances of the root entity to which it is assigned
  • Instance Command: This type of command is used to manipulate the current state of an existing instance of the root entity to which it is assigned

Both command types accept an Input entity (new or existing) and can raise Business Events as well as Business Errors.

Create commands

A command can be added on the instance page of a root entity by using the Add Command capability which can be found in the Associated Commands at this Level section.

Commands are defined using the following master data:

  • Local Identifier: Identifier of the command. this value must be unique within the namespace and cannot be changed afterwards. Please note that only the characters A-z (without special characters), digits and the special character "_" are permitted for naming fields! Furthermore, identifiers may not begin with a digit (required)
  • Label: Label of the command (optional)
  • Short Label: Short label of the command (optional)
  • Notes: Useful information regarding the command definition (optional)
Warning:

Commands cannot have the same Local Identifier as a Service or an Agent in the same namespace.

Edit commands

You can edit a command by visiting a Root Entity's instance page and clicking on the Command in the Associated Commands at this Level section.

Edit master data

You can edit the master data of a command by clicking the Edit command details button in the Command Details section on the command's instance page. The fields that can be edited are Label, Short Label and Notes.

Note:

It's not possible to edit the Type and the Local Identifier of a command.

Add input entity

It is possible to assign an Input entity to a command by either clicking on Create new private entity or Select existing entity in the Input section of the command's instance page. To add properties to the input entity click on the Add capability and choose

  • Create new property
  • Associate existing property

See properties for further details on creating properties.

Add business events

To add a Business Event to a command that will get published each time the command is executed, click on Add event in the Business Events section of the command's instance page. There are two options when adding an Event to a command:

  • Add new event
  • Add existing event

Regarding already existing events, a list of all the events that have been created in a project is shown. It is also possible to search for a specific event using the Search capability. One or more events can be selected in order to be added to the command.

Read more about events.

Add business errors

To add a Business Error to a command that will get returned each time the command cannot be executed, click on Add error in the Business Errors section of the command's instance page. There are two options when adding an Error to a command:

  • Add new error
  • Add existing error

Regarding already existing errors, a list of all the errors that have been created in a project is shown. It is also possible to search for a specific error using the Search capability. One or more errors can be selected in order to be added to the command.

Read more about business errors.

Delete commands

You can delete a command by clicking the Delete command button in the upper right corner of the command instance page. Alternatively, you can use the Delete capability in the Associated Commands at this Level section of the root entity's Overview page.

Warning:

You will need to confirm the action before the selected command gets permanently deleted.