Set the batch size of Work Manager to 1. It forces synchronization between the two threads. Perform the following steps to change the batch size:
Stop the JBoss application server.
Open the [appserver root]/bin/standalone.bat (Windows) or standalone.sh (Linux or UNIX) in an editor and add the Java options -Dadobe.workmanager.allocate.max-batch-size=1
Restart the server.
Start the WebLogic Administration Console by typing http://[host name]:[port]/console in a web browser.
Type the user name and password that you created for the WebLogic Server domain and click Log Under Change Center, click Lock & Edit.
Under Domain Structure, click Environment > Servers and, in the right pane, click the managed server name.
On the next screen, click the Configuration tab > Server Start tab.
In the Arguments box, append the argument -Dadobe.workmanager.allocate.max-batch-size=1
Click Save and then click Activate Changes.
Restart WebLogic managed server.
In the WebSphere Administrative Console navigation tree, click Servers > Server Types > WebSphere application servers.
In the right pane, click the server name.
Under Server Infrastructure, click Java and forms workflow > Process Definition.
Under Additional Properties, click Java Virtual Machine.
In the Generic JVM arguments box, type the arguments -Dadobe.workmanager.allocate.max-batch-size=1.
Click OK or Apply, and then click Save directly to the master configuration.