FeedHenry WFM workorder
A workorder module for FeedHenry WFM.
Dependencies
This module depends on the fh-wfm-mediator WFM module.
Browserify usage in an angular.js client
Setup
This module is packaged in a CommonJS format, exporting the name of the Angular namespace. The module can be included in an angular.js as follows:
angular
Client side events
The module listens for, and responds with the following mediator events:
Listens for | Responds with |
---|---|
workorder:load |
workorder:loaded |
workorders:load |
workorders:loaded |
workorder:save |
workorder:saved |
workorder:save |
workorder:saved |
workorder:create |
workorder:created |
workorder:new |
workorder:new:done |
workorder:selected |
|
workorder:edited |
Integration
Angular controller
Events can be broadcast and listened for in angular controllers using the fh-wfm-mediator API.
Example:
Ui-router integration
This module provides nice integration with the ui-router project.
Listen to events to trigger navigation:
Use the ui-router resolve
API to pre-load data before rendering a page:
Usage in an express backend
Setup
The server-side component of this WFM module exports a function that takes express and mediator instances as parameters, as in:
var express = app = mediator = ; // configure the express app... // setup the wfm routesmediator app;mediator app;
Server side events
the module broadcasts, and listens for the following events
Listens for | Responds with |
---|---|
workorders:load |
workorders:loaded |
workorder:load |
workorder:loaded |
workorder:save |
workorder:saved |
workorder:create |
workorder:created |
Integrating
The application will listen for the above events, and respond with the appropriate data attached to the corresponding response event.
Example:
var _ = ; var workorders = id: 1276001 type: 'Job Order' title: 'Footpath in disrepair' status: 'In Progress' address: '118 N Peoria @N Chicago, IL 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.' id: 1276231 type: 'Job Order' title: 'Road in disrepair' status: 'Complete' address: '2116 Sussex Dr. @Redmond, WA 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.' id: 1276712 type: 'Job Order' title: 'Driveway in disrepair' status: 'Aborted' address: '18 Curve Cr. @San Jose, CA 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.' id: 1262134 type: 'Job Order' title: 'Door in disrepair' status: 'On Hold' address: '623 Ferry St. @Boise, ID 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.' id: 12623122 type: 'Job Order' title: 'Roof in disrepair' status: 'Unassigned' address: '5528 Closed loop @Boston, MA 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.' id: 12623122 type: 'Job Order' title: 'House in disrepair' status: 'New' address: '364 Driver way @Portland, OR 60607' summary: 'Please remove damaged kerb and SUPPLY AND FIX 1X DROP KERB CENTRE BN 125 X 150 cart away from site outside number 3.'; module { console; mediator; mediator; mediator; mediator;}