Resource Ordering Fulfillment Orchestration API (ROFO)¶
This API provides Resource Order Fulfillment-Execution Plan Management capabilities through a REST API interface.
Installation¶
Setup¶
Import the required modules and services:
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { ExecutionPlanService } from '@dnext-angular/rofo';
@NgModule({
imports: [
HttpClientModule
],
providers: [
ExecutionPlanService
]
})
export class AppModule { }
Services¶
ExecutionPlanService¶
Handles retrieval of execution plans for resource orders.
// 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
inventoryId?: string; // Related inventory ID
resourceSpecificationUrl?: string; // Specification URL
// ... additional properties
}
Edge¶
Represents a dependency between nodes:
interface Edge {
from?: string; // From Dependency (null implies START)
to?: string; // To Dependent
}
Usage Examples¶
Basic Execution Plan Retrieval¶
import { ExecutionPlanService } from '@dnext-angular/rofo';
@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);
});
Advanced Response Handling¶
import { HttpResponse } from '@angular/common/http';
// Get full HTTP response
this.executionPlanService.retrieveExecutionPlan(
'plan-123',
undefined,
'response'
).subscribe((response: HttpResponse<ExecutionPlan>) => {
console.log('Status:', response.status);
console.log('Headers:', response.headers);
console.log('Plan:', response.body);
});
Dependencies¶
- @angular/core: ^18.0.0
- @angular/common: ^18.0.0
- @dnext-angular/http
- rxjs: ^7.0.0
Further Information¶
License¶
DNext PiAGroup