Breadcrumbs

Block a Thread

Sometimes it may be necessary to delay the execution of an xUML service. To block the current activity for a given period of time, you can use the Block Thread Adapter.

Figure: Block Thread Action

thread_block.png

Each blocked thread consumes a Bridge license slot. Each blocked thread that contains persistent states also blocks a persistent state worker. For more information on E2E Bridge licensing, refer to License for Running xUML Services and Performance Considerations of Persistent State.

You can use the Action Wizard to add a <<BlockThread>> action. Add an empty action node and select E2E Action Wizard from the context menu.

thread_block_wizard_1.png

Specify the name of the action and select stereotype BlockThread from the list of stereotypes.

thread_block_wizard_2.png

Add the necessary parameter to specify the period of time to wait:

  • Select time to specify a period of time in seconds.

  • Select highResolutionTime to specify a period of time in milliseconds.

thread_block_wizard_3.png

Click Finish.

Parameters

NameTypeDirectionMandatoryDescriptionAllowed ValuestimeIntegerinSpecify a period of time in seconds defining the sleep time.any integerhighResolutionTimeIntegerinSpecify a period of time in milliseconds defining the sleep time.any integerSpecify either time or highResolutionTime or both. If you do not specify any of the two, an exception "Sleep time is missing" will be thrown during execution of the service.

Related Pages: