Difference between revisions of "CatTaskScheduleHelper class"

From Catglobe Wiki
Jump to: navigation, search
Line 28: Line 28:
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
<source lang="javascript">
 
<source lang="javascript">
 +
//RescheduleByMetaDataId
 
CatTaskScheduleHelper csHelper = new CatTaskScheduleHelper();
 
CatTaskScheduleHelper csHelper = new CatTaskScheduleHelper();
 
number taskId = 54183;
 
number taskId = 54183;
 
CatTaskNeverSchedule schedule = new CatTaskNeverSchedule();
 
CatTaskNeverSchedule schedule = new CatTaskNeverSchedule();
 
csHelper.RescheduleByMetaDataId(taskId, schedule);
 
csHelper.RescheduleByMetaDataId(taskId, schedule);
 +
</source>
 +
 +
 +
<source lang="javascript">
 +
//GetTaskStatusByInstanceId
 +
CatTaskScheduleHelper ct = new CatTaskScheduleHelper ();
 +
object e = ct.GetTaskStatusByInstanceId(104675);
 +
print(e.ObjectTypeName);//CatTaskStatusCancelled
 +
print(e.Status);//Rescheduled by user
 
</source>
 
</source>

Revision as of 09:33, 24 July 2017

CatTaskScheduleHelper



Helper class for scheduling CatTasks

Constructors

  • () - Instanciate helper

Methods

  • CatTaskSchedule GetScheduleByInstanceId(int instanceId "Id of an instance of a task") - From an instance, find the task and find its schedule
  • CatTaskSchedule GetScheduleByMetaDataId(int taskId "Id of a task") - From a task, find its schedule
  • CatTaskStatus GetTaskStatusByInstanceId(int instanceId "Id of an instance of a task") - From an instance, get the execution status
  • Empty RescheduleByInstanceId(int instanceId "Id of an instance of a task", CatTaskSchedule schedule "The new schedule to use") - From an instance, find the task and alter its schedule
  • Empty RescheduleByMetaDataId(int taskId "Id of a task", CatTaskSchedule schedule "The new schedule to use") - From a task, alter its schedule
  • string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • TypeInformation TypeInformation { get; } - Get information about this class.


Examples

//RescheduleByMetaDataId
CatTaskScheduleHelper csHelper = new CatTaskScheduleHelper();
number taskId = 54183;
CatTaskNeverSchedule schedule = new CatTaskNeverSchedule();
csHelper.RescheduleByMetaDataId(taskId, schedule);


//GetTaskStatusByInstanceId
CatTaskScheduleHelper ct = new CatTaskScheduleHelper ();
object e = ct.GetTaskStatusByInstanceId(104675);
print(e.ObjectTypeName);//CatTaskStatusCancelled
print(e.Status);//Rescheduled by user