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 in Linx Application Designer
Download the sample file (helloworld.zip).
Open the HelloWorld.lsoz solution file with Linx Application Designer.
To the left of your screen, in the Solution Explorer section and nested under Project, click on HelloWorld.
On the main canvas (in the center of the interface), click on HelloWorld.
In the Properties section for the TextFileWrite (HelloWorld) function, note the File path value: C:\tmp\HelloWorld.txt.
- Note: A file called HelloLinx.txt will be created in the C:\tmp folder.
In the Solution Explorer section, click on the Timer service.
In the Properties section for the Timer service, note the execution intervals: 00:01:00 (every minute).
Debug the HelloWorld process.
- Note: The debugger executes the process once, it does not start the Timer event for any future executions. To achieve automation of the process flow, the Solution must be deployed / uploaded to Linx Application Server.
To run the sample on Linx Application Server
In Linx Application Designer, change the File path to a path on your server, e.g. f:\mydrive\helloworld.txt
Log in to your Linx Application Server.
From the top menu, click Server > Upload Solution.
Select your application file.
Select the START ALL SERVICES checkbox.
Click ADD SOLUTION.
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. every minute, and that the file's content is "Hello World...".
b. On Linx Application Server, check that the Event executed successfully.
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:\tmp\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.
The default property values of the Timer Service were retained:
a. Mode: Interval
b. Run every: 00:01:00 (every minute)
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