2.4. Invoking Actions

Being able to edit entities makes it easy to build CRUD-style (create/read/update/delete) applications. Wicket Objects also allows arbitrary actions to be performed on entities. In the screenshot below, we see the Add Item action (corresponding to addItem() method on the Claim class) being called:

Because this action takes parameters, Wicket Objects renders a dialog form for the user to complete. Just as with the entity editor, we can specify parameters of any type, including references to other entities if we wish). In this particular case the parameter types are just numbers and strings:

When the action is complete, the entity is modified, by adding a new ClaimItem into the Claim's items collection.

Admittedly, this Add Item action just a CRUD-style action. But the business logic in the action could be arbitrarily complex. The other action in Claim is Submit, which could perform lots of business processing:

This action also takes an argument, being a reference to an Approver:

When the action is performed, the object's state is updated, along with any other processing. For example, a message could have been sent via an ESB to the processing department. Note the title of the Claim entity has also been updated: