Hello,
I'm creating a job with a Loop and a condition. When I open the job in the GUI it looks fine. When I start it it does not loop.
When I manually remove the condition in the GUI and then add it again in the GUI everything is fine. It seems I'm missing something when adding the condition in code. What could that be ??
The C# script I'm using is this:
public static void createHttpTask(string servername)
{
Console.WriteLine("ASDF");
JobClass job = new JobClass();
job.Name = "job3http";
job.Group = "rl cj";
job.Description = "mein zweiter Job";
TaskClass task = job.AddTask(TaskClass.TaskT.HTTP);
task.Name = "T1";
task.HTTP.Method = "GET";
task.HTTP.ContentTypeHeader = "application/x-www-form-urlencoded; charset=UTF-8";
task.HTTP.URL = "http://server/.....";
JobLoopSettingsClass jls = new JobLoopSettingsClass();
jls.LoopSettings.LoopType= LoopSettingsClass.LoopT.WhileLoop;
jls.LoopSettings.MaxIterations = 300;
jls.LoopSettings.ValueX = "asdf";
jls.LoopSettings.ValueY = "asdf";
jls.LoopSettings.Wait.Use = true;
jls.LoopSettings.Wait.Seconds= 30 ;
jls.StartTaskId = task.Id;
jls.EndTaskId = task.Id;
jls.Name = "myloop";
job.AddLoop(jls);
List<ConditionSetClass> cscs = server.Conditions.GetAll();
foreach (ConditionSetClass csc in cscs)
{
Console.WriteLine(csc.Description);
Console.WriteLine(csc.Id);
if (csc.Description == "X4 ArcIn Jobs bis 21:00 Uhr")
{
task.Conditions.Add(csc.Id);
}
}
server.Jobs.Update(job);
}
my environment is:
VC 8.0.4
Win 2012 R2 64bit
Edited by moderator
2016-04-14T21:49:24Z
|
Reason: Not specified