Hi,
I'm looking to be able to create a job and task with conditions using the ASDK on ITMS 8.5 RU 3, the creation of the Job and tasks are all fine but when I try to create a condition I'm unable to do so.
Reviewing the XML and the condition xml seems different and was wondering if there is additional xml needed?
Here is the steps I'm following:
1.) create task -> save return GUID of task
2.) create client job -> save return GUID of client job
3.) add task to client job -> save return task node GUID
4.) create condition -> error
The asdk example is:
Guid jobGuid = new Guid("Some GUID");
Guid taskGuid = new Guid("Some task GUID");
// add existing task to a Job
var taskNodeGuid = m_proxy.AddTaskFirstToJob(jobGuid, taskGuid);
// define conditions to be evaluated
string conditionRules = @"
<conditionRules>
<rule>
<taskNodeGuid>"+ taskNodeGuid + @"</taskNodeGuid>
<conditionType>WHERE</conditionType>
<conditionOperator>Equals</conditionOperator>
<conditionValue>4</conditionValue>
</rule>
<rule>
<taskNodeGuid>"+ taskNodeGuid + @"</taskNodeGuid>
<conditionType>OR</conditionType>
<conditionOperator>Equals</conditionOperator>
<conditionValue>5</conditionValue>
</rule>
</conditionRules>";
// create condition
var conditionNodeGuid = m_proxy.CreateJobCondition(jobGuid, taskNodeGuid, conditionRules);
// NB! save it only if finally completed editing a Job
m_proxy.ConfirmJobChanges(jobGuid);
The error in the Altiris log viewer is:
Failed parse job condition rules
Invalid parameter xml. A task output property name field was not supplied
[Altiris.ASDK.ASDKInvalidParameterException @ Altiris.ASDK.Task]
at Altiris.ASDK.Task.Utilities.BuildJobConditionRuleCollection(String xml)
at Altiris.ASDK.Task.Web.TaskManagementService.CreateJobCondition(Guid jobGuid, Guid taskNodeGuid, String conditionRules)
Exception logged from:
at Altiris.ASDK.Task.Web.TaskManagementService.CreateJobCondition(System.Guid, System.Guid, String)
at RuntimeMethodHandle.InvokeMethod(Object, Object[], Signature, Boolean)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object, Object[], Object[])
at System.Reflection.RuntimeMethodInfo.Invoke(Object, System.Reflection.BindingFlags, System.Reflection.Binder, Object[], System.Globalization.CultureInfo)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object, Object[])
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(System.Web.HttpContext)
at System.Web.Script.Services.ScriptHandlerFactory+HandlerWrapper.ProcessRequest(System.Web.HttpContext)
at System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(System.Web.HttpApplication+IExecutionStep)
at System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication+IExecutionStep, Boolean&)
at System.Web.HttpApplication+PipelineStepManager.ResumeSteps(Exception)
at System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, AsyncCallback)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus&)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr, System.Web.RequestNotificationStatus&)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)
User [DOMAIN\MYUSER], Auth [Soap_Proxy], AppDomain [/LM/W3SVC/1/ROOT/Altiris/ASDK.Task-8-132496556473666125]
HTTP [POST]: https://XXX/Altiris/ASDK.Task/TaskManagementService.asmx
ip: [192.168.10.12]; content-length: [720];
response: [200 OK]; x-smp-nsversion: [8.5.5032.0];
-----------------------------------------------------------------------------------------------------
Date: 11/12/2020 1:54:10 PM, Tick Count: 105787859 (1.05:23:07.8590000), Host Name: XXX, Size: 3.01 KB
Process: w3wp (25924), Thread ID: 166, Module: w3wp.exe
Priority: 1, Source: Altiris.ASDK.Task.Web.TaskManagementService.CreateJobCondition
File: C:\ProgramData\Symantec\SMP\Logs\a.log
If anyone know where to obtain the new way of adding job conditions please let me know.
Thanks in advance .
Rufus Swart