Support Article
Interaction Log
SA-3290
Summary
You perform what is essentially some sort of readonly operation. The operation generates a History entry for the work item. After this operation, further operations may either fail or open in a new window.
Error Messages
There may be no error messages or you may get a "transactionid mismatch" error.
Steps to Reproduce
It depends upon the custom architecture of your application.
Root Cause
The root cause is a defect in Pegasystems’ code/rules. The seeming readonly operation adds a history record to record what the user did. This record is added via CPMAddHistory activity and this activity does a commit. This changes the transaction id and in turn causes the harness to be out-of-synch with the server.
Resolution
This is fixed in CPM 7.1.3. Where they prevent the commit of the history record from modifying the main transaction.
You can commit a nested transaction without affecting the main one by using the following lines of Java:
You add this Java Step right before History-Add Step:
PegaDatabase pdRef = (PegaDatabase)tools.getThread().getDatabase();
pdRef.setCurrentTransaction("ExpressAction"); // <== Can be any name/string
You add this Java Step at end of the Activity after the Commit:
try{
PegaDatabase pdRef = (PegaDatabase)tools.getThread().getDatabase();
pdRef.assertTransactionComplete();
}
catch(DatabaseException e) {}
PegaDatabase pdRef = (PegaDatabase)tools.getThread().getDatabase();
pdRef.assertTransactionComplete();
}
catch(DatabaseException e) {}
Tags:
Published January 31, 2016 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.