Page 1 of 1

ProcessRollback

Posted: Mon Jan 10, 2022 2:58 pm
by Wim Gielis
Hi all,

EDIT: it's a non-issue, rookie mistake :-)


Best wishes for 2022 !

I have a simple TI process to load data. So the Prolog tab does a zero out in a reporting cube, grabs data from an input cube.
Then the Data tab will CellIncrementN the values. All pretty straightforward.

However, when errors are encountered (and I know which errors to flag) I would like to do a rollback of the process.
Meaning that nothing has changed and the "target slice" of data is not zero if the slice was not 0 before the load started.

I have a variable "nErrors" that is set to 1 when an error is encountered in the Data tab. The line is skipped.

In the Epilog, I check for errors:

Code: Select all

If( nErrors = 1 );
ProcessRollback;
EndIf;
This does not work. The zero out is done, and data points without an error are still visible in the target cube.
I tried ProcessError as well (in the Epilog tab).

Does anyone know how this should be done ? I don't want to abuse the Metadata tab or use a different TI process to achieve the same result.

Interestingly, a simple CellPutN in the PROLOG tab and a ProcessRollback; in the Epilog, and no other code, does work and the value is not visible in the cube !

https://www.ibm.com/docs/en/planning-an ... ssrollback

Best regards,

Wim

Re: ProcessRollback

Posted: Mon Jan 10, 2022 3:15 pm
by Steve Rowe
Never used the function so can't offer any direct advice but....(and I'm embaressed to suggest this)

Just in case you still have a New Years hangover are you counting the number of errors instead of just setting a flag value? This might explain why the rollback isn't getting executed?

Perhaps a rollback at the end of the data tab when the first error is encountered would work better?

Re: ProcessRollback

Posted: Mon Jan 10, 2022 3:28 pm
by Wim Gielis
Thanks Steve.

It must have been the New Years hangover...

I had the ItemReject in the Data tab before the nErrors incrementing !

Code: Select all

   ItemReject( '...' );
   nErrors = nErrors + 1;
Case closed. Thanks for an extra pair of eyes.