Post Job Program With Parameters

bcorbin

New member
Hello,

I have been tinkering with ways to handle file renaming and such after the job has finished running in a separate program. The one thing I'm not sure of after looking through the documentation is whether or not it's possible to pass arguments to a C# console application as a post job using the job information. So for example:

A job copies to a destination on some server \\serverName\CopiedHere and has finished. I think want this job to kick off a Console application, most likely from a batch file or powershell script including the \\serverName\CopiedHere path. This way my application knows where the job copied to and can manipulate the files.
 
Hi bcorbin,
Thank you for your question. Yes, there are several ways you can accomplish this. One way is to use GSAPI to get the job data and parse the destination information from a JSON layout and then use it.
Alternatively, since you already have the job defined with the destination, you can have the batch file (or PS file) run as a post-operation while it calls your command line. (this is easy if you know the destination ahead of time, unless this is created dynamically, then the GSAPI is your best option).

Feel free to reach out to mailto:[email protected] to drill deeper into your request.

- Alex
 
Yeah, my issue is that I don't have that information. The idea here is that we've got multiple jobs that users are generating and running to copy files. So the program I'm running won't have any access to the job data unless the job itself can pass values into our calling programs. Using GSAPI to export information isn't all that helpful because I would need some way to know which job to export. If I tried doing it based on jobsyncendtime or something along those lines it's not a guaranteed that the job that most recently finished is the job we're running this from. So if I could do something like:

powershell.exe -File %location% -jobNumber %job%

where %location% would be something I provide, but jobNumber would get provided by the job.

I can certainly reach out to support for more information. I might be able to get something working by utilizing the GSAPI. Like utilizing a unique identifier in the jobName as well as a passed argument that I could then search based on the job name.

Thanks for the help!
 
Back
Top