Skip to content

Service Ordering Fulfillment Orchestration API (SOFO)

This API provides Service Order Fulfillment-Execution Plan Management capabilities through a REST API interface.

Installation

npm install @dnext-angular/sofo

Setup

Import the required modules and services:

import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { ExecutionPlanService } from '@dnext-angular/sofo';

@NgModule({
  imports: [
    HttpClientModule
  ],
  providers: [
    ExecutionPlanService
  ]
})
export class AppModule { }

Services

ExecutionPlanService

Handles retrieval of execution plans.

// Retrieve an execution plan by ID
retrieveExecutionPlan(
  id: string,
  fields?: string,
  observe?: 'body' | 'response' | 'events'
): Observable<ExecutionPlan>

Models

Core Models

Addressable

Base interface for addressable entities:

interface Addressable {
    id?: string;      // Unique identifier
    href?: string;    // Reference of the target resource
}

Entity

Base entity schema extending Extensible:

interface Entity extends Extensible {
    id?: string;      // Unique identifier
    href?: string;    // Reference of the target resource
}

ExecutionPlan

Describes the dependency graph of orchestration logic:

interface ExecutionPlan extends Entity {
    orderRef?: OrderRef;  // Reference to the order
    nodes?: Nodes;        // Array of execution nodes
    edges?: Edges;        // Array of dependencies
}

Graph Components

Node

Represents a single node in the execution plan:

interface Node {
    itemId?: string;                      // Order Item Id
    orderId?: string;                     // Order Id
    fulfillmentStatus?: 'completed' | 'inProgress' | 'pending';
    isBundle?: boolean;                   // Bundle indicator
    orderItemAction?: string;             // Order Item Action
    // ... additional properties
}

Edge

Represents a dependency between nodes:

interface Edge {
    from?: string;    // From Dependency (null implies START)
    to?: string;      // To Dependent
}

Usage Examples

Retrieving an Execution Plan

import { ExecutionPlanService } from '@dnext-angular/sofo';

@Component({...})
export class ExecutionPlanComponent {
  constructor(private executionPlanService: ExecutionPlanService) {}

  getExecutionPlan(planId: string) {
    this.executionPlanService.retrieveExecutionPlan(planId)
      .subscribe({
        next: (plan) => {
          console.log('Execution Plan:', plan);
        },
        error: (error) => {
          console.error('Error retrieving plan:', error);
        }
      });
  }
}

Working with Fields Parameter

You can specify which fields to include in the response:

// Only retrieve specific fields
this.executionPlanService.retrieveExecutionPlan(
  'plan-123',
  'id,nodes,edges'
).subscribe(plan => {
  console.log('Filtered plan:', plan);
});

Dependencies

  • @angular/core: ^18.0.0
  • @angular/common: ^18.0.0
  • @dnext-angular/http
  • rxjs: ^7.0.0

Further Information

License

DNext PiAGroup