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.
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 Application Designer and executed on Linx Application Server.
The high-level, end-to-end process to follow when creating and executing a Service:
- Open Linx Application Designer
- Create a new Solution
Utilities plugin for the DirectoryWatch and Timer services
RabbitMQ plugin for the RabbitMQService service
Web plugin for the RESTWebService and SOAPWebService services
Create a new Process
Add Functions to the Process
Debug the Process
Add a Service (See the example below for detailed steps.)
Call the Process from the Service Event
Deploy the Solution to a Linx Application Server
Open your Linx Application Server
Access the deployed Solution
Start the Service
Verify Event execution and results
Example: Creating a Timer Service
The steps to follow when adding a Timer service to a Solution:
1. In Linx Application Designer, add the Utilities plugin to your Solution.
2. From the Utilities plugin, drag and drop the Timer service onto the main canvas.
3. Click on the Timer in the Solution Explorer section to set the timer Properties. (These will determine when the Timer Event should be triggered to execute your process.)
- Include days - Select the days on which the automated process (timer) should be run
- Exclude days - Select the days on which the automated process (timer) must not run, e.g. a specific date, or a specific weekday.
- 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.
- 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.
- 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.
- 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.
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. Click on the Timer Event (in the Solutions Explorer section) to add specific Functions or Processes for the Event to execute:
to add a Function, drag it from the relevant Plugin onto the main canvas
to add a Process, drag it from the Solution Explorer panel onto the main canvas
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 Application 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.