Trying to pass simple data between pre- and post-processing in Method Directive

Hello all - first time user here… apologize pre-emptively for any protocol gaffs…

Inheritied a Method Directive that sends a requisition approval email once a Dispatcher is selected.
I moved most of the code from pre- to post-processing to access updated data, BUT I need to pass the RowMod value that I can only find in pre-proc., and get it over to post-proc.:
Tried using System.Collections.Concurrent.ConcurrentDictionary. Set key/value pair in pre-p., can retrieve it while in pre-p., but can’t reference it in post-processing. If I instantiate it again in post-p. I lose access to the data (due to the ‘new’ ketyword…).
Now trying, instead, to use CallContext - but confused when following blogs.

Any simple example would be greatly appreciated.

Thanks in advance.

Vytas

There is the CallContextBPMData (or something close to this name :slight_smile:).
Use it just like any table, but instead it is only a single row. There are a bunch of fields that you can use to pass values from the Screen to the BPM, from Pre to Post, etc.

Just make sure you keep track of which ones are used where, otherwise you can end up with multiple BPMs using the same field… As a best practice, empty the field once you are done with it.

That is indeed good practice however it’s worth noting that the CallContextBPMData is exclusive to individual bo adapter instances and screens

Which can sometimes be a pain but it does protect you to some extent if you forget to clean it

1 Like