The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

if logic in PPM commands

Highlighted
GJS-NT
Occasional Advisor

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]	
fi	

 This fails with the following error message.

An error occurred during command parsing.
 (KNTA-10127)
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.

2 REPLIES
Jason Nichols K
Honored 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:

 

[P.P_ENVIRONMENT] = 'uat'

 

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.

Utkarsh_Mishra
Honored 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>;

fi

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
//Add this to "OnDomLoad" event