This image shows a flow chart of actions that occur in the class-based Shared Data area, and are broken down into three steps:

  1. In the Shared Data Module, specify the python module to load on command line. It must contain a function, CreateSharedObject(), that the driver calls to create shared data. If this option is not used the driver creates an empty dictionary.

  2. From the Python Shared Module, CreateSharedObject(), the flow divides into two paths: Device shared data, and Transaction shared data.

    1. In Device shared data, CreateSharedObject() is called when a device is managed to create device shared data that persists for the duration of the device within the driver. It will not persist across a driver restart. Scripts access the shared device data by calling _device.getLifetimeSharedData().

    2. In Transaction shared data, CreateSharedObject() is called for each transaction to create data that persists for the duration of the transaction to create shared data that persists for the duration of the transaction (per device). Scripts access the shared transaction data by calling _device.getThisCommitSharedData().

  3. Both paths go to the CDK Script.

  4. In the CDK Script, once a script has a reference to the shared data it can read and write data. For example: getData() or setData().