Hello everyone,
I need your help to solve a problem that is driving me crazy : I got an error from service broker, trying to parse a file passed as inputFile(Mime).
I'll explain my usecase:
- users upload a txt into Service broker with a list of vms (VMs List)
- In VMs field I put an action that parse "VMs List" and check if the vm exists in our environment
If I run the workflow in Orchestrator, everything runs fine :
but if run from Service Broker, it fails with error :
I'm running on 8.18 Automation and the code for checkVmsFromFile is here :
//load file content split by lines
var fileContent = inputfile.content.split(/\r\n|\n/)
//System.log("fileContent > " + fileContent)
vmWithError = new Array()
for each (var vmName in fileContent) {
//System.log("vmName > " + vmName)
var found = Server.findAllForType("VC:VirtualMachine", "xpath:name='" + vmName + "'")
//System.log(found.length)
//check if the inserted vm exists or not
if ( found.length == 0) {
System.log(vmName + " NOT FOUND")
vmWithError.push(vmName + " NOT FOUND")
}
}
if ( vmWithError.length == 0 ) {
vmWithError.push("Check VMs SUCCESSFULLY Completed")
}
return vmWithError.sort()
Can someone help me to solve this problem ?