Use Commands For Hub-Spoke Orchestration

Updated on March 13, 2023

Once a Hub Request is created either manually or with the help of API, users have to execute the following set of commands through the developer console to perform Portability or RTBF from Hub org to Spoke org.

Command 1 – 

cchub.HubSchedulableService.scheduleHubSpokeSyncBatch(null,null);

This command helps us to sync Hub Spoke Object & its Fields from any Spoke Orgs. Once this command gets executed it will fetch all the Hub-Spoke Object and Hub-Spoke field records to the Hub Org in the related list of the Spoke Configuration detail page.

By clicking on any Hub-Spoke object records a user can find Hub-Spoke field records. As shown in the below screenshot.

Command 2 – 

cchub.HubSchedulableService.scheduleRequestIntitateBatch(null,null);

This command is used for the actual processing of data in the spoke org. This command includes three different processes which are executed one by one –

  • It will create Spoke request records. Users will find all the newly created Spoke Request records in the related list of the respective Hub-Request records.
  • Based on the SOQL/where clause in the Hub-Spoke Object records it will fetch the Data Subject Ids from each of the spoke org. Those Data Subject Id records will be stored in the respective Spoke Request record. 
  • With all the necessary inputs gathered in the Spoke Request record, Privacy-Security will trigger the Spoke API (RTBF/Portability). Here the actual operations for RTBF and Portability take place in Spoke and the user gets the case Id and status for all the Spoke requests on the Hub request record.  This will include success as well as errors for any record processing from any Spoke org along with the possible reason for an error message in respective spoke requests.

Command 3 – 

cchub.HubSchedulableService.scheduleStatusRequestBatch(null,null);

This command includes two different processes which are executed one by one – 

  • Initially, this command was used to fire GET spoke API which contains all the details about the case and the initial status of the operation. 
  • After the above operation, the next process gets started and after execution, the user can see the final status for the record in Hub org. For all the successful spoke requests, the status will be “Processed” for both the Operations (RTBF/Portability) and in the Sub-Status field, for successful RTBF operation Sub-Status will be “Processed” and for successful Portability operation Sub-Status will be “Attachment Generated”.

Note: In the case of Portability, the user can find the generated JSON file in the related list of Hub-Spoke requests as well as the respective Spoke Request record.

Command 4 – 

cchub.HubSchedulableService.scheduleRetryBatch(null,null);

This command includes a single process. 

The command is used to edit the status of Errored records of Hub Request & Spoke Request and changes it to “Open”. Once the errors get solved these records based on their Statuses will be picked by executing Command 2 in the next run.