Working with Services

In Linx, Services are the starting point to all process flows, enabling the automation of solutions.

Services have Events that get fired to execute the Processes that are linked to them. A Service can fire one or more Events e.g. a Timer service fires a TimerEvent, a DirectoryWatch service fires a CreatedEvent, DeletedEvent, etc.

Available Services

  • DirectoryWatch (from the File plugin)

    To watch a directory for file changes, creations, renaming and deletions. The Service will call a process or run some logic when the service event occurs.

  • RabbitMQService (RabbitMQ plugin)

    To listen to a queue on a RabbitMQ server and to trigger an event when a new message arrives.

  • MSMQService (MSMQ plugin)

    To listen to a MSMQ queue and to trigger an event when a new message arrives.

  • Cron (Utilities plugin)

    To execute a process periodically at a fixed time, date, or at intervals.

  • Timer (Utilities plugin)

    To execute a process at a specified time and interval.

  • RESTWebService (Web plugin)

    To assemble and publish a REST web service endpoint by implementing its web methods through events.

  • SOAPWebService (Web plugin)

    To assemble and publish a SOAP web service endpoint by implementing its web methods through events.


Creating a Service

A Service and its Events, as well as the Processes that are associated with an Event are created in Linx Designer and executed on Linx Server.

High-level process

The high-level, end-to-end process to follow when creating and executing a Service:

Steps:

  1. Open Linx Designer
  2. Create a new Solution
  3. Add Plugins

    Utilities plugin for the DirectoryWatch and Timer services

    RabbitMQ plugin for the RabbitMQService service

    Web plugin for the RESTWebService and SOAPWebService services

  4. Create a new Process

  5. Add Functions to the Process

  6. Debug the Process

  7. Add a Service (See the example below for detailed steps.)

  8. Call the Process from the Service Event

  9. Deploy the Solution to a Linx Server

  10. Open your Linx Server

  11. Access the deployed Solution

  12. Start the Service

  13. Verify Event execution and results


Example: Creating a Timer Service

The steps to follow when adding a Timer service to a Solution:

Steps:

  1. In Linx Designer, add the Utilities plugin to your Solution.
  2. From the Utilities plugin, drag and drop the Timer service onto the main canvas.
  3. Set these Properties:

    a. Name

    b. Include days

    Select the days on which the automated process (timer) should be run.

    c. Exclude days

    Select the days on which the automated process (timer) must not run, e.g. a specific date, or a specific weekday.

    d. Mode

    Select either ‘Interval’ or ‘Specific times’. When selecting ‘Interval’, also set the following property values: Run every, Starting time, and Run for. When selecting ‘Specific times’, also set the following property value: Run at.

    e. Run every

    Enter the time interval between each run. The value format is: HH:mm:ss (i.e. hours, minutes and seconds). E.g. 00:30:00 will trigger the timer event to run every 30 minutes.

    f. Starting time

    Enter the time of day from which the timer will run. The value format is: HH:mm:ss (i.e. hour, minutes and seconds), utilizing the 24 hour cycle where 2pm is 14:00:00.

    g. Run for

    Duration of time for which the timer will run as per the selected intervals. The value format is HH:mm:ss (i.e. hour, minutes and seconds). E.g. 05:00:00 will cause the timer event to run for 5 hours after the selected Starting time, and at the selected intervals.

    h. Run at

    Enter the time of day that the trigger will run on the selected days. The value format is: HH:mm:ss (i.e. hour, minutes and seconds), utilizing the 24 hour cycle where 9pm is 21:00:00.

  4. Call a Process from the Service Event

    a. Drag an existing applicable Process onto the main canvas of the Timer service.

    b. Click here for samples.

  5. Deploy the Solution

    a. In Linx Designer, click the Deploy button on the Menu bar.

    b. Select the server to deploy to.

    c. Click the Deploy button.

  6. Access the deployed Solution

    a. Log in to Linx Server.

    b. On the System Overview screen, from the list of displayed solutions, click on your Solution.

  7. Start the Service

    a. On the Solution Dashboard screen, click the Start button for the service you want to execute.

  8. Verify Event execution and results

    a. Verify execution status

    On the Solution Dashboard screen, the service should indicate “Started”. Also, in the Services section, the newly started service should be reflected by the incremented value of the “Started” counter.

    b. Verify execution result

    On completion of the service’s execution, in the Events section the result should be reflected under either “Successes” or “Failures”. In case of Failure, the Error Types section will display brief details of the error that caused the event to fail.

    c. Verify execution output

    In case an event executed successfully the actual output of the event (e.g. file, email, etc) could also be verified.


Demo Video

Using the DirectoryWatch service in conjunction with the Amazon S3 plugin


Also see

Design for automation

Linx Designer – A Basic Solution

Linx Server – Quick Start

Plugins Utilities

Samples