When you execute a User Defined Process (UDP) from SCM Workbench, and it fails or does not produce the result you were expecting, how is it possible to find the problem and fix it?
CA Harvest SCM all versions and platforms
A User Defined Process is a process set up within a specific project and state that runs a command or script. When your UDP is not working as expected, the first thing to do is find the properties for the UDP so that you can see what script or command it is executing.
The properties window for the UDP looks like this:
Two important thing to notice are
In the above example, the command the UDP is running is
C:\Scripts\MyTestScript.bat [broker] [project] [state]
In the above example, C:\Scripts\MyTestScript.bat is the custom script that is being run by the UDP, and the rest of the information in the Program field lists options or parameters (specific data values) being passed into the script.
If you see options or parameters in the Program field surrounded by square brackets, these are "Harvest System Variables". They are not the operating system variables you would define outside of Harvest. Instead these allow you to pass context-relevant information to the command or script such as the broker name, project or state, package, user, etc. In the above example we are passing the broker name, the project name, and the state name into the script.
You should be able to execute the command or script you see in the Program field from a command prompt window. If the "Type" field says "Server" it will run from a command prompt on the broker machine. If the "Type" field says "Client" it will run on the machine where Workbench is running. A good first test when diagnosing a problem with the UDP is to try to run it from the command prompt window, after substituting actual values for any "Harvest System Variables" specified on in the Program field. For the above example, the command we will use to test is:
C:\Scripts\MyTestScript.bat win2k12r2 SampleProject Development
When I execute this on my test system, I see:
In this case the command worked as expected, but if it did not, the next step would be to locate the script and troubleshoot any problems it might be having. For this you will need to have programming experience, or someone with this type of training to debug your script to find any problems and correct those. When the script is able to run successfully from a command prompt window, try it from Workbench again to confirm the problem is resolved.
You can read more about User Defined Processes here: https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/harvest-scm/14-0/administrating/define-lifecycle-processes.html#concept.dita_9d1af57a6e7508bdfb52bd5bb809bb4a0a451617_DefineaUserDefinedProcess
You can read more about System Variables here: https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/harvest-scm/14-0/administrating/use-the-system-variables.html