Re: executing special commands (sc_***) within an IF construct (427 Views)
Reply
Occasional Contributor
arnoldr315
Posts: 4
Registered: ‎08-20-2013
Message 1 of 8 (486 Views)

executing special commands (sc_***) within an IF construct

Can I execute a special command within an IF construct in PPM (8.10) ?  I have Unix code within the workflow step source logic that I need to have an IF or Do While logic.  Obviously, PPM doesn't recognize multi-line codes wiithin an IF or Do While construct. 

My intended solution is creating this step source logic as a special command that I can execute multiple times.

 

Any other way of doing this ?

 

thanks

Please use plain text.
Honored Contributor
Utkarsh_Mishra
Posts: 696
Registered: ‎07-13-2010
Message 2 of 8 (480 Views)

Re: executing special commands (sc_***) within an IF construct

You can put your IF condition in the CONDITION section of the commnad. You can call multiple commands in the execution step or any command section or can create you own special command with multiple conditions.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Please use plain text.
Occasional Contributor
arnoldr315
Posts: 4
Registered: ‎08-20-2013
Message 3 of 8 (473 Views)

Re: executing special commands (sc_***) within an IF construct

Thanks for the quick reply.  I have tried doing the solution you mentioned but I couldn't get the COND stmts to work.  My issue is that I have a counter within the code that gets populated.  I then need to execute this 'special' logic X number of times depending on the counter.

 

Also, every time the logic needs to get executed, there are variables within that needs to be changed/updated (like server names etc.)

 

arnold r.

Please use plain text.
Honored Contributor
Jim Esler
Posts: 715
Registered: ‎05-09-2008
Message 4 of 8 (437 Views)

Re: executing special commands (sc_***) within an IF construct

The solution to your problem is to build the loop in the workflow, not in the commands of a single workflow step. The execution step will execute the commands for a single instance. Additional steps will manage a loop counter and re-execute this execution step the desired number of times. The Deployment Management Configuration Guide has directions for setting up this kind of workflow process and includes some examples.

Please use plain text.
Honored Contributor
AlexSavencu
Posts: 593
Registered: ‎04-30-2010
Message 5 of 8 (432 Views)

Re: executing special commands (sc_***) within an IF construct

Hi,

Jim's solution is a good one, but be careful on the number of times it will actually execute in total. I have a customer who implemented similar approach and they ended up with a total of 70+ million records in the transaction tables, which then caused the graphical view of any workflow to load in about 10 minutes.

Jim, I think you are referring to the Demand Management Configuration Guide.

Arnold, why are you not making use of a Unix script that you can call with parameters from an execution step, and implement any logic you need in the Unix script?

Cheers
Alex

--remember to kudos people who helped solve your problem
Please use plain text.
Occasional Contributor
arnoldr315
Posts: 4
Registered: ‎08-20-2013
Message 6 of 8 (430 Views)

Re: executing special commands (sc_***) within an IF construct

Hi Jim, 

Feasible solution but I think it will further complicate the existing workflow I have.  I will still explore that though.

 

Hi Alex,

I am not exactly a Unix programmer, and I'm learning as I go along.  The script approach is what I tried via the 'special command' solution.  If you're referring to a different unix script that can be executed within the workflow step source code, I'd like to know more about it.

 

thanks

 

arnoldr

Please use plain text.
Honored Contributor
Jim Esler
Posts: 715
Registered: ‎05-09-2008
Message 7 of 8 (427 Views)

Re: executing special commands (sc_***) within an IF construct

We have used the script method, too. We have used shell scripts (ksh) and perl scripts to manage the looping behavior. The number of iterations is definitely a consideration. One process that handles all registered users, for instance, is done in a perl script. We also use scripts to parse individual values in a multi-select field. Processes that act on each entry in a table component use the workflow loop process. Tokens are used to get the values for each table entry in turn.

 

It looks like both the Demand and Deployment guides have the same content describing workflow loops.

Please use plain text.
Honored Contributor
AlexSavencu
Posts: 593
Registered: ‎04-30-2010
Message 8 of 8 (407 Views)

Re: executing special commands (sc_***) within an IF construct

Hi,

For the Unix script: if you have basic programming experience you should be able to create bash scripts, or you can call on your system administrator.

Cheers
Alex

--remember to kudos people who helped solve your problem
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation