This sample creates a Timer service that will, at a predetermined time, automatically create a text file with the content: "Hello World".
To achieve this, our Linx solution will use the File plugin and the Timer service contained in the Utilities plugin.
To run the sample
Download the sample file (HelloWorld.zip).
Open the HelloWorld solution with Linx Designer.
In the Properties section for the TextFileWrite (HelloWorld) function, note the File path value: C:\temp\HelloWorld\HelloWorld.txt - update this value to a suitable path, or create the C:\temp\HelloWorld\ directory on your machine.
In the Properties section for the Timer service, note the Run at value: "11:45:00" - update this value to a suitable time, or deploy your solution to Linx Server and wait for 11:45 to see the end result.
Debug the HelloWorld process.
Deploy the HelloWorld Solution to Linx Server.
Start the Service.
Creating the sample
The following steps can be used to re-create the solution used in this sample, or to use as a guide when deploying and running the sample:
Create a Solution, Project, and Process with descriptive names.
Add the following Plugins to your Solution:
From the File plugin, add the TextFileWrite function to your process, and rename it to HelloWorld.
Click on the TextFileWrite (HelloWorld) function in the main canvas, then enter the following details in the Properties section:
a. File Path - The full path of the file, in this case "C:\temp\HelloWorld\HelloWorld.txt".
b. Contents – The text data to write to the file, in this case "Hello World".
c. File exists – Select "Overwrite file" from the drop-down list.
From the Utilities plugin, add the Timer Service to the Project.
Enter the details of the Properties associated with the Timer Service:
a. Mode – Select "Specific times" from the drop-down list.
b. Run at – Enter the time for the service event to run, in this case "11:45:00".
Set up your TimerEvent by doing the following:
a. Click on TimerEvent in the Solution Explorer section
b. Drag and drop HelloWorld from the Solution Explorer section onto the main canvas – the effect of this is that, when triggered, TimerEvent will call the HelloWorld function
Debug the process
For details on how to debug, please go here
Deploy the Solution to Linx Server
For details on how to deploy your Solution, please go here
Start the Service on Linx Server by doing the following:
a. Log in to Linx Server
b. Select the applicable Solution
c. Click the Start button to start the service
Verify the successful creation of your HelloWorld file
To check whether your service is executing as expected, do the following:
a. In the specified directory, check that the HelloWorld.txt file was created at the time the Timer service was supposed to execute, e.g. at 11:45, and that the file's content is "Hello World".
b. On Linx Server, check that the Event executed successfully