Website logo
Docs
API Reference
Postman Collection
Release Notes
Navigate through spaces
⌘K
Introduction
Overview
Getting started with the OS1 Platform
Getting started with building Apps
Concepts
Working with Callbacks
Console UI Overview
Custom Code
Working with GraphQL
Custom Attributes Ownership
Attribute-Based Access Control (ABAC)
Data Listing and Query (DLQS) Search
Core API dev guides
Overview
Authentication And Authorization
Participant
Container
Dispatch
Orchestrator
Workflow
Secure Data Storage
File Management
State Machine
Entity
Notification
Motion Tracking System
Location
Platform Order Management
Address
Scheduler
Logistics Framework API Dev guides
Overview
LogisticsOrder API
User API
Facility API
Vehicle API
How-To Guides
Integrate Your Application with Console UI
Integrate with Participants
Integrate with Containers
Integrate with Users
Integrate with Vehicles
Integrate with Facilities
Integrate with Entities
Integrate with Dispatch
Integrate with Logistics Order
Integrate with Platform Order Management
Integrate with Location Service
Integrate with Orchestrator
GraphQl Schemas
GraphQL: Dispatch Queries
GraphQL: Order Queries
GraphQL: Workflow Queries
GraphQL: Container Queries
Platform SDKs
SDK Overview
Sample Apps
Vehicle Management App
Container App
Resources
FAQs
Glossary
Data Types Used in OS1
Development Guidelines
Entity, Event, and Reason Codes
Service/API Level Error Codes
Docs powered by Archbee
Core API dev guides
Orchestrator

Work Order Manager Plugin

8min

This plugin will interpret the current event and, if required, it will update an existing WorkOrder.

Use case

Single leg - Update the work order status based on job updates.

Input

  1. tenantId
  2. orderId
  3. workOrderId
  4. workOrderPickupLocation
  5. workOrderDeliveryLocation
  6. jobStatus
  7. eventCode
  8. reasonCode
  9. location
  10. callback

Output

  1. UpdateWorkOrderStateEvent (status = IN_PROGRESS)
  2. UpdateWorkOrderStateEvent (status = COMPLETED)

Logic

  1. jobStatus == IN_PROGRESS && location == workOrderPickupLocation → UpdateWorkOrderStateEvent (status = IN_PROGRESS)
  2. jobStatus == COMPLETED && location == workOrderDeliveryLocation && reasonCode == “R-0065” → UpdateWorkOrderStateEvent (status = COMPLETED)

Current Configuration

Rules

Job Complete Success Rule

Job Complete Success Rule
{
    "name": "Complete Job Success",
    "event": "CompleteJobEvent",
    "pluginWorkflowId": "plugin-workflow:6e33bb8f-7ca2-5a7a-add5-fc651c5048af",
    "serviceName": "orchestrator",
    "logic": {
        "==": [
            "$.reason",
            "R-0065"
        ]
    }
}


Job Complete Failure Rule

Job Complete Failure Rule
{
    "name": "Job Started",
    "event": "JobStartedEvent",
    "pluginWorkflowId": "plugin-workflow:6e33bb8f-7ca2-5a7a-add5-fc651c5048af",
    "serviceName": "orchestrator"
}


Plugin Workflow

JSON
{
    "name": "CompleteJobWorkflow",
    "description": "workflow for job completion",
    "tag": [
        {
            "name": "workOrderManager",
            "value": "workflow"
        },
        {
            "name": "containerManager",
            "value": "workflow"
        }
    ],
    "pre": {
        "plugins": [
            "fetchData"
        ]
    },
    "main": {
        "plugins": [
            "workOrderManagerPlugin",
            "containerManagerPlugin"
        ]
    }
}


Plugin

JSON
{
    "name": "workOrderManagerPlugin",
    "httpUrl": "https://delhivery.preprod.fxtrt.io/core/api/v1/workOrderManager/",
    "httpMethod": "POST",
    "httpHeaders": {
        "plugin": "workOrderManager"
    },
    "httpRequestBodyTemplate": [
            {
                "outputJsonPath": {
                    "tenantId": "$.tenantId",
                    "orderId": "$.orderId",
                    "jobStatus": "$.status",
                    "reason": "$.reason"
                }
            },
            {
                "entity": "order",
                "input": {
                    "tenantId": "$.tenantId",
                    "id": "$.orderId"
                },
                "outputJsonPath": {
                    "workOrderId": "$.workOrders[0].id",
                    "workOrderPickupLocation": "$.workOrders[0].pickupDetails.location",
                    "workOrderDeliveryLocation": "$.dropDetails.location",
                    "workOrderStatus": "$.workOrders[0].status"
                }
            },
            {
                "entity": "job",
                "input": {
                    "tenantId": "$.tenantId",
                    "id": "$.jobId"
                },
                "outputJsonPath": {
                    "location": "$.objectives[1].location",
                    "workOrderId": "$.workOrderId"
                }
            }
        ],
    "dlqOnFailure": true,
    "requestTimeout": 5,
    "callbackTimeout": 5,
    "responseType": "ASYNC",
    "secretKey": "SECRET_KEY",
    "protocol": "HTTP"
}


Try Work Order Manager Plugin API.

Updated 03 Aug 2023
Did this page help you?
PREVIOUS
Container Manager Plugin
NEXT
Workflow Manager Plugin
Docs powered by Archbee
TABLE OF CONTENTS
Use case
Input
Output
Logic
Current Configuration
Rules
Plugin Workflow
Plugin
Docs powered by Archbee