This content has been marked as final. Show 4 replies
We use a number of custom agents in our jobs so I can give you some pointers if not direct answers (I'm not the programmer that writes our agents). I hope this helps.
First, you are confusing me by mentioning a PIF file. VB creates Windows programs and a PIF file is not needed. Besides, Central is firing off the program and, if I recall correctly, a PIF file would be for a manual startup from a desktop icon for a DOS program. Anyway, we don't have any PIF files. We just copy the EXE to the server and set up all the other necessary stuff for running it.
Second, we have been unable to figure out a method to set the exit value from within the VB application. I'm not saying there isn't a method, just that we haven't found it (VB.NET). If you don't know how or don't find a way then you will have to use the file method described in chapter 6.
I don't understand what you mean by "specify it in Control". Or what you are going to specify. You can certainly put all the necessary options on the ^job line or define them within the task definition.
have to modify the jfserver.ini file. Central will not run anything unless there is a section within the file that describes where to get the EXE from. You might as well define the location of the INI file (if there is one) while you are there. This would be a section similar to [JFMERGE] but the EXE name would be between the brackets (no '.exe').
There is one "gotcha" that you have to be aware of. For all tasks within the job, the parameters on the ^job line that is in the original file is
used for the duration of the job. You can have an agent change stuff and pass the file on to other tasks but the following tasks will not see the changes as command-line parameters.
In our application most of our jobs are multiple tasks. Our custom agents read the input file specified on the command line, do whatever is needed and then write an output file. File names come from the @INFile & @OutFile variables supplied by Central (unless we have a specific name we want. The output may or may not have changes depending on the purpose of the agent.
We do have one agent that essentially does what you need to do. Though it doesn't search for particular fields (other of our agents do) it does change ^job parameters, including the name of the job. It reads the input file, changing the ^job parameters, builds a temporary file that is a copy of the input file (with the job name change). When it is done it then copies this temporary file into the collector folder. The file has to have a different physical name or Central will delete it (or copy it to the backup folder).
We have a plugin (DBConnect) that runs on Java. When installed I didn't have to do anything to the jfserver.ini file. That's why I was wondering if you can just set the parameters when you set up a new task (specifying in Control). Is it because our current plugin is java and not an EXE?
Thanks for the information Tom! I will update this once I try and get the agent working.
To run a java application from the command line you run java.exe, which is an executable file. The syntax is like this: "java my_java_program".
Actually you don't need to configure the jfserver.ini, IF you set up a task where you specify the absolute path for your program.
If you have to launch the program MyPrg which is installed under C:\Program files\MyInstallDir, then you just put this line in the command line field in the task configuration screen in JetForm:
It will run. You can even run batch files like that as well as any other executable, Java included.
Marco - I didn't consider putting the full path within the task description. We completely emulated all the provided tasks by just having the program name defined in the task. That is how I learned that I had to add the sections to the jfserver.ini file. I can see that providing the full path within the task definition would eliminate that requirement.