Origin and Target Context

The subscriber context includes an origin and target context, each of which can contain a list of technical products (TPs). shows a simplified view of the subscriber context and its use.

The subscriber context


Note:

The subscriber context is always referred to using the scId, and never using an explicit object reference.

Custom code creates ::sodata::SCServiceFactoryName Factory

package myCustomSC
{
 [ local ]
 entity genesis
 {
  [ initialize ]
  void start();
 };
 [ extentless ]
 interface SCServiceFactory : ::sodata::SCServiceFactory
 {};
 [ extentless ]
 entity SCServiceFactoryImpl
 {
   [ virtual ]
   void initializeServiceFactory();
 };
 expose entity SCServiceFactoryImpl with interface SCServiceFactory;
};
action myCustomSC::genesis::start
{`
  declare SCServiceFactory factory;
  declare string factoryName = ::sodata::SCServiceFactoryName;
 
  select factory from SCServiceFactory using name
   where (factory.name == factoryName) on empty create;
`};

Custom code then has to provide at least one implementation of SelectSubscriberContext method:

package myCustomSC
{
 [ extentless ]
 interface SCService1 : ::sodata::SCService
 { };
 [ extentless ]
 entity SCService1Impl
 {
  [ virtual ]
  void SelectSubscriberContext(
   in ::sodata::ServiceOrderData i_sod,
   in ::prov::ServiceCallback i_serviceCB);
 };
 expose entity SCService1Impl with interface SCService1;
};

Initialization of each service:

action myCustomSC::SCServiceFactoryImpl::initializeServiceFactory
{`
  declare SCService1 service1;
  select service1 from SCService1 using primary
  where(service1.name == "SCService1") on empty create;
`};
action myCustomSC::SCService1Impl::asyncSelectSubscriberContext
{`
 // Creates the subscriber context
 // ------------------------------
 declare sodata::SubscriberContext sc;
 declare ::sodata::ServiceOrderData sod = i_sod;
 assert(!empty sod);

 declare string scId = sod.scId;
 assert(scId != "");
 create sc values(scId: scId);
 sod.subscriberContext = sc;

 // get from external system info about Customer « scId »
 // and add each Item to Origin Context as follow:

 if (!sc.addItem(i_contextScope : sodata::Origin,
    i_itemType : sodata::TechnicalProduct,
    i_itemName : <Tpname>,
    i_sourceId : "SC One"))
 {
  errMsg = "ERROR Cannot add item "+<Tpname>;
  return false;
 }

 // Calls the callback
 // ------------------
 declare ::prov::ServiceCallback cb = i_serviceCB;
 assert(!empty cb);
 cb.executionCompleted(
  i_order: sod,
  i_status: ::prov::OK,
  i_errorMsg: "");
}`};

Fulfillment Provisioning Catalog uses the value of the parameter named ::sodata::SC_SERVICENAMEPARAM (equal to « SC_SERVICENAME ») found in the dataset of the ServiceOrderData to know which service it has to ask to Factory « SubscriberContextService ». In the example, dataset of ServiceOrderData has to have the following entry:<<SC_SERVICENAME = SCService1>>

If no Service is found Fulfillment Provisioning Catalog returns an error. Otherwise, Fulfillment Provisioning Catalog calls the execute method on the Service, that retrieves the SubscriberContext using custom code if not found in ossm or a swapped file.

If Delta Analyzing is enabled for the current ServiceOrder, Fulfillment Provisioning Catalog uses the SubscriberContext in the DeltaAnalyzing step to calculate the Target Context and deduce the correct list of Technical Products that have to be processed. Fulfillment Provisioning Catalog retrieves the correct Service using an external call method SelectSubscriberContext if scId is populated.