Repository.Task.AddScheduledTask: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|Repository}}</noinclude>
{{Template:Repository.AddScheduledTask.Cmt}} {{Template:BooleanReturn.Cmt}}


==Syntax==
Saves a new [[CScheduledTask Class|cScheduledTask]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the scheduled task now exists in the repository.
*AddScheduledTask( task{{APIPrefix|As}}[[cScheduledTask Class|cScheduledTask]] ){{APIPrefix|As Boolean}}
<noinclude>
== Syntax ==
''object''.'''Task.AddScheduledTask(''task'')'''


Parameters
where ''object'' is a variable that represents a Repository object.
:''task'': The [[cScheduledTask Class|cScheduledTask]] to add.


== Usage Example ==
=== Parameters ===
  {{APIComment|'Declare a new repository connection object.}}
{| {{APITable}}
   Dim MyRepository As New Repository
|-
    
|task{{APIParam|Required}}||The [[CScheduledTask Class|cScheduledTask]] object to be added.
  {{APIComment|'Connect to the Synthesis repository.}}
|}
   Dim Success As Boolean = False
 
   Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
    
== Example ==
  {{APIComment|'Set a first available project as current.}}
'''VBA'''
  MyRepository.Project.SetCurrentProject(0)
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Create a new scheduled task. The following example creates a task named "MyNewTask."}}
   {{APIPrefix|Dim}} NewTask {{APIPrefix|As New}} cScheduledTask
   NewTask.Name = {{APIString|"MyNewTask"}}
  {{APIComment|'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1) 
   {{APIPrefix|Call}} MyRepository.Task.AddScheduledTask(NewTask)
 
'''VB.NET'''
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
{{APIComment|'Create a new corrective task. The following example creates a corrective task named "MyNewTask."}}
  {{APIPrefix|Dim}} NewTask {{APIPrefix|As New}} cScheduledTask ({{APIString|"MyNewTask"}})
   
   
  {{APIComment|'Declare a new cScheduledTask.}}
  {{APIComment|'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh.}}
   Dim newScheduledTask As New cScheduledTask("NewScheduledTask1")
   MyRepository.Project.SetCurrentProject(1)   
 
   MyRepository.Task.AddScheduledTask(NewTask)
{{APIComment|'After creating the task, update the repository}}
</noinclude>
   Dim SuccessAddScheduledTask As Boolean = False
   SuccessAddScheduledTask = MyRepository.Task.AddScheduledTask(newScheduledTask)

Revision as of 22:26, 16 July 2015

APIWiki.png


Member of: SynthesisAPI10Repository

Saves a new cScheduledTask object to the Synthesis repository. Returns a Boolean value; when true, indicates that the scheduled task now exists in the repository.

Syntax

object.Task.AddScheduledTask(task)

where object is a variable that represents a Repository object.

Parameters

Name Description
taskborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status The cScheduledTask object to be added.


Example

VBA

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new scheduled task. The following example creates a task named "MyNewTask." 
 Dim NewTask As New cScheduledTask
 NewTask.Name = "MyNewTask"

 'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Task.AddScheduledTask(NewTask)
VB.NET

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new corrective task. The following example creates a corrective task named "MyNewTask." 
 Dim NewTask As New cScheduledTask ("MyNewTask")

 'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Task.AddScheduledTask(NewTask)