Skip to main content

1E 8.1 (on-premises)

Using the Tachyon PowerShell Toolkit to manage Tachyon schedules

How to use the Tachyon PowerShell Toolkit to manage Tachyon schedules.Tachyon schedules allow you to set up a schedule for an instruction to be run either once, or on a regular basis. Optionally, you can specify a conditional evaluation script which is to be run server-side when the instruction has been run.

You can specify whether the script should always run, or only based on an evaluation of the row count returned by the instruction. For example, you can define that the conditional evaluation script should only run when the instruction returns more than 10 rows of data.

Note

Tachyon schedules support a wide range of schedule options. The PowerShell Toolkit supports a subset of these options, for simplicity.

Core scheduling concepts

When you specify a schedule, you can define:

  • How often the schedule should run (for example, daily, every 10 minutes etc)

  • Where the schedule is only triggered at most once in any day, the start time on which the schedule should be triggered

  • Where the schedule is triggered multiple times in any day, the start time and end time between which the schedule should be triggered

  • For schedules which trigger on a weekly or monthly basis, you can optionally define which day of the week or which week of the month the schedule should trigger on.

Creating a Tachyon schedule

You use the publish-tachyonscheduledtask cmdlet to create a schedule.

As a minimum, you must specify:-

  • The name of the instruction to be scheduled.

  • Values for any parameters for the instruction that do not already have defaults defined in the instruction

  • The target scope for the instruction

  • The schedule for the instruction.

For example:-

publish-tachyonscheduledtask -InstructionName 1E-Explorer-TachyonAgent-Echo -Targetscope urth -Schedule Daily

If you do not specify a StartDate and EndDate parameter, then the schedule is assumed to start today and finish tomorrow.

Note

For schedules which operate over a longer rescheduling period than a day, these defaults will cause the cmdlet to throw an exception, indicating that no schedule events would have taken place with the specified parameters.

You will need to provide additional parameters which define at least an appropriate end date for longer schedule periods (for example, weekly or monthly) to be created.

For a description of the full set of cmdlet parameters, please refer to Tachyon Server management cmdlets.

Schedule creation and workflow

The creation of a schedule requires workflow approval. The scenario below demonstrates how to test this.

It is assumed in the example below that workflow has been set up for self-approval. Consult the appropriate Tachyon platform documentation for more information on workflow configuration.

Note

If workflow has been configured for normal approval by a separate approver, you will need to run the toolkit in two windows, logged on as the initiator in one, and as the approver in a second. You can use the windows 'runas' command to start new PowerShell sessions as a different user than your current logged-on identity. Alternatively, you can use the -Credential parameter to the set-tachyonserver cmdlet to provide alternative credentials in a separate PowerShell window, so that the session runs in the context of the approver account.

You will then perform the approval in this second PowerShell session, rather than in a single session, as shown in the example below.

Publish the schedule

We will use the simple 'echo' test instruction as the payload. Publish the schedule as a one-time schedule to start immediately.

233276722.png

We receive a workflow approval request via email.

233276721.png
Approve the schedule creation
233276720.png
Verify that the schedule has been invoked

It should appear in history as the most recent item, once the schedule trigger datetime is reached.

233276719.png

Note

Currently, it is necessary to approve a schedule before its first trigger datetime is reached. If this is not done, the schedule may not trigger.