Hello World

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

  1. Download the sample file (helloworld.zip).

  2. Open the HelloWorld.lsoz solution file with Linx Application Designer.

  3. To the left of your screen, in the Solution Explorer section and nested under Project, click on HelloWorld.

  4. On the main canvas (in the center of the interface), click on HelloWorld.

  5. 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.
  6. In the Solution Explorer section, click on the Timer service.

  7. In the Properties section for the Timer service, note the execution intervals: 00:01:00 (every minute).

  8. 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

  1. In Linx Application Designer, change the File path to a path on your server, e.g. f:\mydrive\helloworld.txt

  2. Log in to your Linx Application Server.

  3. From the top menu, click Server > Upload Solution.

  4. Select your application file.

  5. Click UPLOAD.

  6. Select the START ALL SERVICES checkbox.

  7. Click ADD SOLUTION.

  8. 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:

  1. Create a Solution, Project, and Process with descriptive names.

  2. Add the following Plugins to your Solution:

    • Utilities
    • File
  3. From the File plugin, add the TextFileWrite function to your process, and rename it to HelloWorld.

  4. 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.

  5. From the Utilities plugin, add the Timer Service to the Project.

  6. The default property values of the Timer Service were retained:

    a. Mode: Interval

    b. Run every: 00:01:00 (every minute)

  7. 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.

  8. Debug the process.

    For details on how to debug, please go here