Table of Contents

Method UpdateTask

Namespace
Skyline.DataMiner.Core.DataMinerSystem.Common
Assembly
Skyline.DataMiner.Core.DataMinerSystem.Common.dll

UpdateTask(object[])

Updates the specified task. Replaces: slScheduler.SetInfo(userCookie, TSI_UPDATE (2), taskData, out response);

int UpdateTask(object[] updateData)

Parameters

updateData object[]

Array of data as expected by old Interop call.

Returns

int

Returns 0 if successful.

Examples

int taskId = 100;
string taskDescription = "Updated Task description";
DateTime startDate = DateTime.Now.AddDays(5);
DateTime endDate = DateTime.Now.AddDays(10);

string activStartDay = startDate.ToString("yyyy-MM-dd");
string activStopDay = endDate.ToString("yyyy-MM-dd");

string startTime = startDate.ToString("HH:mm:ss");
string endTime = endDate.ToString("HH:mm:ss");

string taskType = "once";   // Task type     (1=once , 2=weekly, 3=monthly, 4=daily)
string runInterval = "1";   // Run interval  (x minutes(daily) / 1,...,31,101,102(mothly)   / 1,3,5,7 (1=monday, 7=sunday)(weekly))

string scriptName = "scriptName";
string elemLinked = "";     //"PROTOCOL:1:123:456",   // example of linking element 123/456 to script dummy 1
string paramLinked = "";

object[] schedulerTaskData = new object[]
{
/*
varData => PPSA

[0][0][*] : general info
	  [0] : task id
	  [1] : name					(empty = no change)					
	  [2] : start date (YYYY-MM-DD) (empty = no change)
	  [3] : end date (YYYY-MM-DD)	(empty = no change)
	  [4] : start run time (HH:MM)	(empty = no change)
	  [5] : task type				(empty = no change)
	  [6] : run interval			(empty = no change)
	  [7] : # of repeats before final actions are executed (empty = no change)
	  [8] : description				(empty = no change)
	  [9] : enabled					(empty = no change / TRUE or FALSE)
	  [10]: End time	
	  [11]: minutes interval for weekly/monthly tasks 
   [1][*]	  : repeated actions		([1][0][0] empty = don't change actions)
	  [0] : type
	  ... : extra info
   [2][*]    : final actions			([2][0][0] empty = don't change actions)
	  [0] : type
	  ... : extra info

result:
	E_FAIL/E_INVALIDARG
	S_OK
*/
	new object[]
	{
		new string[]    // general info
		{
			taskId.ToString(),               // [0] : task ID
			taskName,                        // [1] : name
			activStartDay,                   // [2] : start date (YYYY-MM-DD) (leave empty to have start time == current time)
			activStopDay,                    // [3] : end date (YYYY-MM-DD)      (can be left empty)
			startTime,                       // [4] : start run time (HH:MM)
			taskType,                        // [5] : task type     (daily   / monthly            / weekly /                      once)
			runInterval,                     // [6] : run interval  (x minutes / 1,...,31,101,102   / 1,3,5,7 (1=monday, 7=sunday)) (101-112 -> months)
			"",                              // [7] : # of repeats before final actions are executed
			taskDescription,				 // [8] : description
			"TRUE",                          // [9] : enabled (TRUE/FALSE)
			endTime,                         // [10] : end run time (HH:MM) (only affects daily tasks)       
			""                               // [11]: minutes interval for weekly/monthly tasks either an enddate or a repeat count should be specified
		}
	},
	new object[]  // repeat actions
	{
		//new string[]
		//{
		//	"automation",           // action type 
		//	scriptName,             // name of automation script
		//	elemLinked,             // example of linking element 123/456 to script dummy 1
		//	paramLinked,            // ... other options & further linking of dummies to elements can be added
		//	// elem2Linked,
		//	"CHECKSETS:FALSE",
		//	"DEFER:False",			// run sync
		//}
	},
	new object[] {} // final actions
};

int returnValue = scheduler.UpdateTask(schedulerTaskData);

Exceptions

ArgumentNullException

updateData is null.