Automatically Generate a Test Case

In this case a Test Case is generated automatically from the process instance then it can be ran N times to study any problem with the process.

This case can be separated in two scenarios: 1) Create a test case to run it on the same server that the error happens 2) Create a package to be imported in another GS server The new Test Class includes all needed tests to reach the last task executed in the process and all needed resources of the process (such as forms).

Create the Test Class | processInstance testGenerator | processInstance := BpmProcessDefinition getProcessInstanceWithId: 1500319936. testGenerator := BpmProcessExecutionTestGenerator newOn: processInstance. testGenerator generateTestClass. Where [1500319936] is the ID of the process instance. In this case the generated class (with all its methods and resources) is: Proc1500319936ProcessExecutionTest

Scenario 1 In this scenario the test case is executed in the same GemStone/S server that the errors happens so there are no problem with executed scripts.

When the Test Executed a new instance of the process is created so is not the same process but a clone is used to study the actual process. The test case can be executed N times (no restrictions here).

Scenario 2 In this scenario the package that includes the Test Case (by default 'BpmRuntime_Tests_Automatic') has to be exported from GS1 and imported on GS2.

To import the package from GS1 in GS2: 1) Copy the files ''$GS_HOME/shared/repos/BpmFlow/repository'' in to GS2 server 2) Evaluate the following: Gofer new directory: '$GS_HOME/shared/repos/BpmFlow/repository'; package: 'BpmRuntime_Tests_Automatic'; load.

Limitations of Scenario 2: * Bpm Scripts must have all resources in server GS2 in order to be executed * Seaside tasks are NOT fully supportted (only OrbeonForms are supported)

Execute the Test Case 1) Open an SUnit browser 2) Select 'BpmRuntime_Tests_Automatic' package 3) Select the Test Case and execute it

For more imformation see issue #952: https://github.com/brunobuzzi/BpmFlow/issues/952