- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2020 12:48 PM
New to ServiceNow, please go easy on me 😛 I have a delete method AirWatch rest message that is being executed as a workflow activity. The API developer documentation for the AirWatch API states:
Delete Device
Functionality – Deletes the device information from the AirWatch Console and un-enrolls the device.
HTTP Method – DELETE
API URI – https://host/api/mdm/devices/{id}
You can delete a device using the following parameter:
Response Obtained – NA
Request payload – NA
When I execute the rest message as part of the workflow, the intended result from AirWatch is achieved, the object is indeed deleted. But a few observations:
- The activity in the sctask is marked as an error.
- If I hover my mouse over the activity in the workflow history, I can see it states "Fault Description: Error executing REST request: null"
- The rest message does not actually make an entry in the sys_outbound_http_log table even though I've enabled logging to All on the rest message.
- At the time the activity is executed, I can see the following stack trace on the syslog table:
REST Msg Outbound - RESTMessageClient : Error executing REST request: null: java.lang.NullPointerException: com.glide.communications.events.DirectHTTPEvent.getRequestBody(DirectHTTPEvent.java:226)
com.glide.outbound_http_log.log_entry.AllLogEntry.<init>(AllLogEntry.java:18)
com.glide.outbound_http_log.LogEntryFactory.getAllLogEntry(LogEntryFactory.java:89)
com.glide.outbound_http_log.LogEntryFactory.getLogEntry(LogEntryFactory.java:53)
com.glide.outbound_http_log.OutboundHTTPEventWatcher.watch(OutboundHTTPEventWatcher.java:40)
com.glide.communications.HTTPClient.notifyWatcher(HTTPClient.java:503)
com.glide.communications.HTTPRequest.notifyWatcher(HTTPRequest.java:219)
com.glide.communications.HTTPRequest.send(HTTPRequest.java:182)
com.glide.communications.HTTPRequest.del(HTTPRequest.java:148)
com.glide.rest.outbound.direct.DirectRESTRequestDispatcher.doDelete(DirectRESTRequestDispatcher.java:161)
com.glide.rest.outbound.direct.DirectRESTRequestDispatcher.doRequest(DirectRESTRequestDispatcher.java:103)
com.glide.rest.outbound.direct.DirectRESTRequestDispatcher.invoke(DirectRESTRequestDispatcher.java:50)
com.glide.rest.outbound.RESTMessageClient.invoke(RESTMessageClient.java:100)
com.glide.rest.outbound.RESTMessageClient.execute(RESTMessageClient.java:78)
com.snc.runbook_automation.element.providers.RestMessageJavaGateway.executeAndGetHTTPResponse(RestMessageJavaGateway.java:146)
com.snc.runbook_automation.element.providers.RestMessageProvider.doTask(RestMessageProvider.java:145)
com.snc.runbook_automation.element.providers.WebServiceProvider$1.doEvent(WebServiceProvider.java:235)
com.glideapp.workflow.element.ElementActivityProvider.handleEvent(ElementActivityProvider.java:189)
com.glideapp.workflow.element.ExecutingActivity.handleEvent(ExecutingActivity.java:64)
com.glideapp.workflow.queue.activity.ActivityManager.runActivity(ActivityManager.java:330)
com.glideapp.workflow.queue.activity.ActivityManager.runActivities(ActivityManager.java:260)
com.glideapp.workflow.queue.activity.ActivityManager.processCommand(ActivityManager.java:156)
com.glideapp.workflow.queue.command.ActiveCommandQueueDelegate.signal(ActiveCommandQueueDelegate.java:97)
com.glideapp.workflow.queue.command.ActiveCommandQueueDelegate.processCommand(ActiveCommandQueueDelegate.java:62)
com.glideapp.workflow.queue.command.CommandManager$CommandQueue.processCommand(CommandManager.java:367)
com.glideapp.workflow.queue.command.CommandManager.queue(CommandManager.java:135)
com.glideapp.workflow.WorkflowHelper.handleEvent(WorkflowHelper.java:176)
com.glideapp.workflow.WorkflowHelper.handleEventById(WorkflowHelper.java:266)
com.snc.discovery_automation.RBSensorProcessor.processSensors(RBSensorProcessor.java:54)
com.snc.discovery.SensorProcessor.processSinglePage(SensorProcessor.java:403)
com.snc.discovery.SensorProcessor.process(SensorProcessor.java:217)
sun.reflect.GeneratedMethodAccessor2169.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292)
org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2585)
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)
org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
org.mozilla.javascript.Context$ScriptCaller.call(Context.java:2939)
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3429)
org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:164)
com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:82)
com.glide.script.Evaluator.evaluatePossiblePrefixedString(Evaluator.java:210)
com.glide.job.RunScriptJob.evaluateScript(RunScriptJob.java:166)
com.glide.job.RunScriptJob.execute(RunScriptJob.java:87)
com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:108)
com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:111)
com.glide.schedule.JobExecutor.execute(JobExecutor.java:95)
com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:329)
com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:192)
com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)
com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:192)
com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:100)
I'd like to know if there is some noobish mistake I'm making? I can't imagine I'm the first person to cross this situation there, so I feel like there must be something I'm overlooking. Worst case scenario, I'll have the next activity check for the device I just tried to delete and branch from there, but this is fairly messy and would like to avoid it if at all possible. Thanks!
Solved! Go to Solution.