Inject Job throws script error

Post Reply
nna
Member
Posts: 30
Joined: Tue Jul 21, 2020 9:57 am

Inject Job throws script error

Post by nna »

Hi all

A flow of mine is throwing an unexpected script error on Inject Job (see attached screenshot, says «Error in code line 160» or something along those lines). I'm injecting an XML which picks itself up and the I choose to either inject a job repository if it exists or relay the XML to another folder if it doesn't. I'm on Windows Server 2019, Switch Spring 2021. The path to the repository and the job uses a local path and forward slashes. Any ideas?
Attachments
Bildschirmfoto 2021-10-04 um 12.15.22.png
Bildschirmfoto 2021-10-04 um 12.15.22.png (12.9 KiB) Viewed 4113 times
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Inject Job throws script error

Post by freddyp »

I logged this as a bug because this error should never occur, but it does point to a problem with the setup as well: what does the path look like, does it exist, etc.

I suggest to use the Inject wildcard app instead (https://www.enfocus.com/en/appstore/pro ... t-wildcard). Please report back to let us know what the result was.
nna
Member
Posts: 30
Joined: Tue Jul 21, 2020 9:57 am

Re: Inject Job throws script error

Post by nna »

Thank you for the fast response! The path may or may not exist. I have two exiting connections, one injects the desired repository if it exists, the other is set to "failed". The goal is to check if a job already exists and do something with it if it does. If it doesn't, another workflow is triggered. But I'll try with Inject wildcard and will report back.

EDIT: I'm starting to think that the path is causing the issue. I've tried using Inject Lite aswell and every files is being directed to Problem Jobs. I've attached another screenshot of the messages. It says "Dynamic property 'JobRepository' contains invalid values: Path. I tried leaving out the C:, starting with //, adding a / at the end and leaving it off, left out the variable that returns a value with spaces... None of those things seem to cause the issue.
Attachments
Bildschirmfoto 2021-10-04 um 14.23.40.png
Bildschirmfoto 2021-10-04 um 14.23.40.png (84.74 KiB) Viewed 4090 times
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Inject Job throws script error

Post by freddyp »

Are you injecting a specific job or a job repository? And how did you define the subproperties? Are you using a script expression for "Job name"? Please share the exact settings of all the properties.
nna
Member
Posts: 30
Joined: Tue Jul 21, 2020 9:57 am

Re: Inject Job throws script error

Post by nna »

I'm trying to inject a folder structure. If it exists, it should be injected, if not, the XML file that started the workflow is being processed differently.
I'm not using any scripts. Please find attached my properties for the repository. It's okay that "Job Name" is empty, this folder does not exist yet. I've tried both Inject Wildcard as well as Inject Lite and neither worked...
Attachments
Properties
Properties
Bildschirmfoto 2021-10-25 um 14.28.34.png (23.82 KiB) Viewed 3808 times
Job Name
Job Name
Bildschirmfoto 2021-10-25 um 14.27.51.png (8.75 KiB) Viewed 3808 times
Repository Path
Repository Path
Bildschirmfoto 2021-10-25 um 14.27.37.png (14.53 KiB) Viewed 3808 times
nna
Member
Posts: 30
Joined: Tue Jul 21, 2020 9:57 am

Re: Inject Job throws script error

Post by nna »

Solved the issue. The problem was that the metadata was empty (and will be empty in many cases) which results in an error since Inject Job (and Inject Wildcard and Inject Job Lite) cannot work with an empty job name. I was of the impression that the fail state or the "red traffic light" would catch those cases but it doesn't. I now check if the job name is empty before injecting the job.
Post Reply