Maintenance is complete- We've moved from the domain to click to read more
As part of our journey to complete our separation work and our future integration with Micro Focus, we've now updated our domain for the community. This is an interim step, which will be followed by a series of future update / improvements: - Piloting Idea boards - Refreshing the entire UI. (more to come later) - and more
Project and Portfolio Management Practitioners Forum

if logic in PPM commands


if logic in PPM commands

Can I put "if" logic in a PPM command without connecting to a UNIX host?

I use PPM to perform migrations. I would like to put if logic in the command that would check a selection from an Object Type.


So, what I have is someone will select the environment, UAT Vs. Prod and based on that selection set a hostname to connect to and run the migration commands.


I have tried this just to test.

if [ [P.P_ENVIRONMENT] = 'uat' ]; then	
	ksc_comment **  UAT Server  **	
	ksc_comment [P.P_UAT_SVR]	

 This fails with the following error message.

An error occurred during command parsing.
GUID=859FCAB9-E7AD-7898-C7D6-F110FFA2AF23 Unknown or out of sequence command:
[if [ uat = 'uat' ]; then]


Thanks for any advice on how to handle this.

Jason Nichols K
Acclaimed Contributor.

Re: if logic in PPM commands

It sounds like you need to use the Condition portion of the Step Command.  Just under the Command: field, there is one labeled Condition:  You would want to put Oracle style conditionals in this field to control whether or not a command is executed.  So, in your example, the condition would be:




and then the command steps would be:


ksc_comment ** UAT Server **

ksc_comment [P.P_UAT_SVR]


You would then want to have another step for the Production server with the appropriate Conditions and Steps.

Acclaimed Contributor.

Re: if logic in PPM commands

Use double quotes (") instead of single; it will work. Below is the example (put in both the side of IF)


if [ "[P.P_ENVIRONMENT]"  = "uat" ];

then  <your_code>;


Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)