Subscribe and unsubscribe automatically

A subscription for updates from CPR Batch will automatically be created for the contact when the contact is imported into WorkZone Client.

With CPR Batch, it is possible to automatically subscribe a person when the person is related to one or more open cases, and is not already subscribed to at CPR.

If the person no longer may be subscribed, CPR Batch will automatically unsubscribe the person. For example, if a person is not related to any open cases and the subscription was created more than 7 days ago, the continued CPR subscription for the person is not permitted.

Subscription settings in the Source_record Table

CPR Batch handles subscribing to or unsubscribing from persons that are marked to be subscribe or unsubscribed in the SOURCE_RECORD table.

When you subscribe to a person, the data for this person is retrieved from CPR.

In the SOURCE_RECORD table, two fields are used for subscription settings:

  • SRC_SUBSCRIBED:
  • ‘J’ means that the persons is subscribed to CPR. ‘N’ means that the person is unsubscribed from CPR. The field is maintained by the ImportManager that sets it to ‘J’ when retrieving data from CPR, and to ‘N’ when sending unsubscribing data to CPR.

  • SUBSCRIBED:
  • ’J’ subscribes a person if the person is not already subscribed to CPR. ‘N’ means unsubscribes a person if the person is subscribed to CPR.

When you upgrade the database to WorkZone Content Server 2021.3, all records for the source ‘CPR’ are updated to set the SRC_SUBSCRIBED field to ‘J’ and the SUBSCRIBEDfield to null. This is based on the assumption that all persons for source = ‘CPR’ are subscribed to CPR.

Note:

At a customer site, it may be necessary to adjust the setting for the SRC_SUBSCRIBED field, if the assumption that all persons are subscribed is not correct.

A customer can get a file from CPR that includes all CPR numbers that the customer has subscribed to. The data in this file can be used to set the SRC_SUBSCRIBED field.

The SJP_CPR_ADM.SET_SUBSCRIPTION job

You use the SJP_CPR_ADM.SET_SUBSCRIPTION job to set the SUBSCRIBED field automatically.

Subscribe

The SUBSCRIBED field is set to ‘J’ if the person:

  • Is not subscribed to CPR (SRC_SUBSCRIBED=’N’).
  • Is related to one or more open cases.

If a customer wants another algorithm for automatically subscribing to or unsubscribing from a person, you can create another job that sets the SUBSCRIBED field. You can use the standard WorkZone Content Server Oracle package SJP_CPR_ADM as a template for the job.

Unsubscribe

The SUBSCRIBED field is set to ‘N’ if the person:

  • Is subscribed to CPR (SRC_SUBSCRIBED=’J’).
  • Is not related to any open cases.
  • And it is more than 7 days ago that the data of that person was updated from CPR.

Note:

The default value is 7 days but when you start the job, you can specify any number of days.

Start the SJP_CPR_ADM.SET_SUBSCRIPTION job

Execute the following statement to start the job:

sjp_cpr_adm.job_set_subscription(<start_time>, <delay_days>)
  • <start_time> is ‘trunc(sysdate+2)’ by default. The job runs every night 2 hours after midnight.
  • <delay_days> is 7 by default. It specifies how many days ago the person's data was updated from CPR, see above.