1. Home
  2. DX dev digest
  3. Streamlining field service printing with OutSystems

Streamlining field service printing with OutSystems

Streamlining field service printing with OutSystems

Introduction

In field services, efficient barcode printing is crucial for tracking inventory and facilitating operations. Our recent project enabled Zebra barcode printers to integrate seamlessly with OutSystems while delivering a secure print-anywhere solution for physical printers at sites across Australia.

This task was challenging due to the printers' reliance on WebSockets for communication and security, as well as their distributed nature across various networks and multiple sites nationwide. To provide a more expansive illustration, imagine print jobs cascading across a vast network, engaging with many printers in parallel.

This article explores how we developed a robust Print Server solution to bridge the gap between OutSystems and Zebra printers, enabling distributed field-service printing.

Use case

Our solution targets field service scenarios where barcode printing on Zebra printers is essential, especially in remote locations where accessibility is paramount. The ability to print labels on demand, regardless of location, is vital for efficient inventory management and tracking.

Objective

The primary objective of our project was to enable Zebra printers to print labels via OutSystems, a task complicated by the printers' unique communication requirements. By developing a Print Server intermediary layer, we aimed to facilitate seamless communication between OutSystems and Zebra printers, ensuring reliable and efficient printing operations.

Technologies used

  • OutSystems: for application development and integration
  • WebSockets: for establishing and maintaining communication with Zebra printers
  • .NET Framework: for building the Print Server application
  • Azure WebApp: for hosting the Print Server solution

Challenges to overcome

Implementing WebSocket communication in distributed environments, including managing stateful connections and ensuring compatibility with OutSystems' stateless architecture, is a complex software engineering problem. 

Our solution enables OutSystems to communicate with Zebra printers through a middleware layer that can accept and maintain a WebSocket connection from the printer while exposing a RESTful API for OutSystems to consume. However, WebSockets' inherently stateful nature meant that the server process had to remain active for the duration of the connection, which could span weeks or months. This presented compatibility issues with OutSystems' stateless actions and with constraints imposed by OutSystems Cloud security, which does not allow opening the ports required for printers to reach them directly. We developed a solution that enables seamless communication between OutSystems and Zebra printers, enabling efficient printing operations across various field service scenarios via HTTPS and a secure middle layer.

Configuring a printer requires obtaining its local IP address, which is conveniently displayed on the front screen once it's online. Subsequently, a command containing the Print Server address and relevant parameters, followed by a restart command, was sent from OutSystems via the Print Server. Upon startup, the printer would attempt to connect to the Print Server, making persistent attempts in the event of a network connection loss. On the server side, any connected printer would be immediately provided with print jobs, while maintaining in-memory connections to efficiently relay print job details from the exposed RESTful API. 

Additionally, useful tools were provided for the OutSystems Application, facilitating the listing and searching of connected printers, their statuses, and the history of processed print jobs.

Functionality extension

Our solution extends OutSystems' functionality by enabling it to consume WebSocket connections, a capability not natively supported by the platform. Unlike traditional RESTful APIs, WebSockets maintain a stateful connection, requiring a middleware layer to manage communication between OutSystems and Zebra printers. This Print Server solution fills that gap, ensuring seamless integration and efficient, secure, and reliable printing operations. 

Conclusion

Our Print Server for Zebra barcode printers functionality is a testament to our commitment to overcoming technical hurdles and delivering robust solutions that empower field service organisations to optimise their operations and enhance overall efficiency. With the ability to print labels on demand from any location, businesses can optimise their field service workflows and deliver superior customer experiences. 

Author info

Nigel Lamb

Nigel Lamb

Senior OutSystems Developer

 

Need a digital solution tailored to your needs?

Our team is here to help. Complete the form below and we’ll be in touch shortly.