Scribble.orgCommunity Documentation
The pi4soa tools provide a simple mechanism for documenting the specific use cases associated with a business process, and simulating these use cases against the participants (or services) that are derived from a choreography description, to ensure the choreography description correctly caters for the sequence of interactions defined in the scenarios.
The sub-topics within this section of the user guide describe how a scenario is created and simulated against a choreography description.
The scenario is exercised within a single Java process, which directs the example message to the appropriate participants. These messages are then passed through a pi4soa endpoint monitor or runtime that has been configured with the endpoint projection for that participant. The decision as to whether a particular endpoint is monitored or executed is dependent upon the configuration parameters supplied when simulating the scenario. If the 'Simulate and Execute' menu item is selected, then a list of participant types will be presented, which can be ticked to indicate that they should be executed.
Using this approach, the mechanism simulates a sequence of messages being passed between the endpoints for each of the participants. As the message events for each part of an interaction between a pair of participants is defined (i.e. for the send and receive separately), it enables scenarios to be constructed to test failure situations, as well as successful scenarios.
It is possible to use scenarios to ensure that a choreography defines the expected behavior for all participants. It is also possible to ensure that the implementation of specific participants, given a particular sequence of inbound messages (as part of the overall scenario), produce the appropriate expected message results. Thus, it is both possible to ensure the choreography handles a set of required scenarios, as well as perform unit testing of one or more of those participant services using the same scenarios.
The user should select the 'Other...' menu item from this menu, which will cause a wizard to be displayed with the various items that can be created. Within the list, there is a sub group with the title 'Choreography'. This group contains an entry called 'Scenario' that should be selected:
The user should then press the 'Next' button to see the following form:
This form enables the user to select both the folder, within which the new Scenario should be created (defaults to the folder previously chosen when invoking the context menu), and the name of the scenario (by default this is My.scenario).
When the 'Finish' button is pressed, a new Scenario file (with the specified name) will be created in the nominated folder. An editor will automatically be opened for the newly created Scenario.
The XML schema for the Scenario file is: scenario.xsd
This can be used to create the XML representation of a Scenario directly.