+49 (30) 467086-20 service@microtool.de
Products » objectiF RPM » Requirements engineering » Diagrams » The State Machine Diagram » Assigning Other State Machines to Existing Elements

Assigning Other State Machines to Existing Elements

State machines can be assigned to individual element types (i.e. a goal) or multiple elements (i.e. requirements, bugs, user stories). When multiple element types use the same state machine, you can later decide to create a state machine for a specific element type.

Below is an example of how this is done.

Adjust State Machines Already in Use

When working on a project, you will come across state machines that are used for multiple types of requirements. Below is an example of the Bug sub-stereotype, which in this case needs its own state machine. 

  1. Open the Settings window and go to the State machines package.
  2. Select the state machine … for requirements and execute the Edit command in its context menu.
    If a state machine has already been assigned to a stereotype, you can’t assign any other state machines to it. As a result, you need to remove the stereotype from the state machine.
  3. To remove a stereotype from a state machine, go to the Stereotypes tab, select the corresponding stereotype and click the Delete button.
  1. After clicking Delete, you will be asked if existing states should be deleted.
  2. Click OK to confirm your choices.
  3. In the next dialog, you will be presented with options for Yes and No.

If you click Yes, all existing elements will automatically revert to the start state of the new state machine. If no new state machine has been modelled up to this point, the initial state of the stereotype will be applied.

Alternatively, clicking No means that the states remain the same until the editing dialog of an element is opened. (See section for ‘apply state machine to existing elements’).

Create New State Machines

Create a new state machine and assign the relevant stereotypes.

Now, after creating a bug, a new state machine will be used. This isn’t the case, however, for bugs that already exist; for these, new state machines need to be manually applied.

Apply State Machines
Note
At this point, make sure that the yellow button for Use Standard State Machine is not displayed in the form. If you want to apply a different state machine, open the form through the context menu command Edit at the same time as holding down the CTRL button.

Apply State Machines to Existing Elements

After having created a new state machine, you may want to apply it to pre-existing elements that have a different state machine. This action is performed through the standard dialog and is only possible when you selected No in the previous dialog.

  1. Open a bug.
    If the state machine has changed, the part of the dialog for the state of the element will have a yellow button.
  2. Click on this yellow button.

The new state machine will be applied to the element. Check that the initial state of the new state machine is displayed in the element’s dialog to ensure the action has been performed successfully.

  1. Save your choices.

Apply State Machine After Stereotype Change

Open a requirement and change its stereotype.

You will see the new state machine straight away.

Apply a state and save your choices.