+49 (30) 467086-20 service@microtool.de
Products » objectiF RPM » Create and Execute an Extension Function » Extension function “Derive requirement from block”

Extension function “Derive requirement from block”

Starting with version 5.2.4, you can download the extension function from the Amazon cloud and use it in a project of your choice.

With the extension function you can derive a requirement for a block and save it in a defined package.

The extension function is executed on a block. A requirement is created each time the extension function is executed using an action or command. A satisfy relationship is created between the block and by default the requirement is named Anforderung zu {block name}. You can modify the naming schema as well as determine how the name is entered using parameters.

Tip
Make sure that Node.js is enabled for the service in the Service Manager, otherwise the extension function cannot be executed.

In order for the extension function to work correctly, you will need to do the following after downloading the function:

Define package

Importing the extension function automatically creates a new reference property with the name UseCaseSlicePackage for the stereotype Package. It is therefore only necessary to determine a storage location for the requirements.

  • In the context menu of the package containing the block choose the command Edit.
  • Switch to the tab Further Properties and specify a package for RequirementsPackage by clicking the […].
Configure the extension function

There are various parameters in the extension function that you can adjust. The parameters define how the name is composed for the derived requirement. A distinction is made between whether the extension function is executed using a state action or using a command.

The first parameter (automaticNamePrefix) is not named.
What you enter in the Value column is used when the extension function is executed with an action. By default, the value is set to Anforderung zu. For this value to be used, the value for the second field Name must be empty.

The second parameter Name (requirementName) also defines the name of the derived requirement.
What you enter in the Value column is used when the extension function is executed with a command. By default, no value is set here. The Dynamic option is selected.

 The third parameter Zwischenwort (nameLinkWord) specifies which link word should be inserted between the name of the requirement and the name of the block.
The value is used when the extension function is executed with a command. The value is set to zu by default. The Dynamic option is not selected.

The fourth parameter Zwischenwort (useLinkWord) is an option that allows you to specify whether the link word is used or not.
The option is used when the extension function is executed with a command. The value is set to “true” by default. The Dynamic option is selected.

The Dynamic option is important if you use a command to execute the extension function. If the Dynamic option has been selected for the Name and Link word parameters, you will be prompted to overwrite the values with a dialog box when the function is executed. 

  1. Navigate to the package with the extension function and select Edit from the context menu of the extension function.
  2. Switch to the Parameter tab. Adjust the values according to how you want to use the extension function. 
  1. Close the dialog with OK.
Define parameter for a context menu command

The extension function contains three parameters that specify the name of the requirements. These can be defined as follows:

Enter name directly

If you want to execute the extension function and enter a name directly…

… leave the value of the second parameter blank and select the Dynamic option.

Use the standard name

If you execute the extension function using a context menu command and want the name to be created automatically without any input, modify the value of the second parameter and deselect the Dynamic column. If you want to use a link word, enter a value for the third parameter. To ensure that the names are correctly separated, insert spaces before and after the link word. Deactivate the Dynamic option here as well.

Overwrite the standard name

If you want to give the requirement a “standardized” name, but also want to keep the option to overwrite it …

… enter a name in the Value column of the second parameter and select the Dynamic option.

Overwrite the standard name and the link word

If you want to specify the link word as well as the name individually …

 … enter a name in the Value column of the third parameter (or leave it blank) and select the Dynamic option.

Offer the link word as an option

You also have the possibility to specify with an option whether a link word should be used or not. Select the option if the specified link word is to be used. The block name will be automatically appended behind the name of the requirement and the link word.

If you do not select the option, the name for the requirement that you have predefined, or entered in the name field, will be used. The block name is not appended.

 For the fourth parameter, check the boxes for Value and Dynamic. In addition, deactivate the Dynamic option for the third parameter so that the defined link word is used automatically and cannot be overwritten.

Define parameters for a state action

If you execute the extension function using a state action only, you must adjust the value of the first parameter and make sure that the second parameter Name has no value.

Define an action

If you want to execute the extension function with an action, you’ll need to modify the state machine for blocks. 

  1. Open the Settings window and open the state machine …for block from the state machines package.
  2. In the context of the desired state choose the comand Edit
  1. Switch to the Entry Actions tab, for example, and select the action Run Extension Function by clicking the Plus button behind the entry.
  2. Click on the three dots and select “Anforderung von Block ableiten“.
  3. Close the dialog with OK.
Delete the extension function

If you are using the extension function in an action and/or as a command, you must first delete the command and/or the action. Only then can you remove the extension function by choosing the Delete command in the context menu of the function. This deletes the extension function, but not the extension schema, since it may be contained in other extension functions.