I have to call a process from another process, for that i am using ‘Start Job’ activity.
The Robot has the edit create rights on jobs and process, also the process name I am passing is in the "packageName_environmentName’ format but I’m still getting the error => Start Job: An invalid result was encountered for parameter Process Name
Yes @loginerror exactly, till the time i was following the format mentioned in document it was throwing error in Process parameter, but when i wrote just the process name it worked fine.
This may create confusion for many in future, so thought to inform you.
Using throw will change the job object’s State property to “Failed”. The key is to use the job object returned from Start-Job or Get-Job and check the State property. You can then access the exception message from the job object itself.
Per your request I updated the example to also include concurrency.
$createZip = {
Param ( [String] $source, [String] $zipfile )
if ($source -eq "b") {
throw "Failed to create $zipfile"
} else {
return "Successfully created $zipfile"
}
}
$jobs = @()
$sources = "a", "b", "c"
foreach ($source in $sources) {
$jobs += Start-Job -ScriptBlock $createZip -ArgumentList $source, "${source}.zip"
}
Wait-Job -Job $jobs | Out-Null
foreach ($job in $jobs) {
if ($job.State -eq 'Failed') {
Write-Host ($job.ChildJobs[0].JobStateInfo.Reason.Message) -ForegroundColor Red
} else {
Write-Host (Receive-Job $job) -ForegroundColor Green
}
}
I am receiving this same error, but I am unable to resolve the issue. I have tried all permutations of the package/process name with and without the Environment name added on. Also, all permissions are set exactly as needed.
Here is the message of the error: Exception Message: An invalid result was encountered for parameter Process Name
Here is the stack trace for the error: at UiPath.Core.Activities.TaskExtensions.ThrowIfNeeded(Task task, Boolean suppresThrowException)\r\n at UiPath.Core.Activities.Orchestrator.BaseOrchestratorClientActivity.ThrowIfNeeded(AsyncCodeActivityContext ctx, Task task, Boolean suppresThrowException)\r\n at UiPath.Core.Activities.Orchestrator.BaseOrchestratorClientActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)\r\n at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Here is the Asset where I am storing the process name (note, I have tried all permutations of the Process name, including with or without the version number at the end):