ExecuteProcess with too few parameters supplied

Post Reply
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

ExecuteProcess with too few parameters supplied

Post by Wim Gielis »

Hello all

- If you attempt to use the function ExecuteProcess() and you specify too many parameters, an error is generated.
- If you attempt to use the function ExecuteProcess() and you specify the correct number of parameters, but you have a typo in a parameter name, an error is generated. Good.
- If you attempt to use the function ExecuteProcess() and you specify too few parameters, NO error is generated.
The called process runs and uses the parameter values that it can find. The Message log shows INFO instead of ERROR.

What do you think? Is this good or bad? Do you make use of the fact that you don't need to supply all the parameter values?

Wim
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: ExecuteProcess with too few parameters supplied

Post by EvgenyT »

Hi Wim,

Good point... I think it should be consistent across every scenario.

I find error messages for ExecuteProcess quite vague to be honest... Process couldn't initialize makes sense if you know TM1 well, but if you are rather new then you would be scratching your head for a while, thinking what's gone wrong.

Do you agree?

ET
User avatar
Martin Ryan
Site Admin
Posts: 1988
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: ExecuteProcess with too few parameters supplied

Post by Martin Ryan »

What does it do with the parameters not specified? If it uses the Default values specified when building the TI process then I don't think it's necessarily a bad thing. It makes the variables optional, like in VBA where you don't have to supply things if you just want the defaults to apply.

However if the defaults are not used and it just uses empty string for string parameters or 0 for numeric parameters then I'd go with "Bad".
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: ExecuteProcess with too few parameters supplied

Post by rmackenzie »

Martin Ryan wrote:What does it do with the parameters not specified?
I'm pretty sure it picks up the defaults.
Robin Mackenzie
lotsaram
MVP
Posts: 3652
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: ExecuteProcess with too few parameters supplied

Post by lotsaram »

I'm also positive that ExecuteProcess picks up default values for any non-specified parameters. It may not be consistent with API external calls or RunTI.exe (or the chore scheduler for that matter which requires an explicit value for all parameters and ignores the defaults!) but I guess chalk it up to an advantage of using the internal TI function as opposed to those methods.
User avatar
Harvey
Community Contributor
Posts: 236
Joined: Mon Aug 04, 2008 4:43 am
OLAP Product: PA, TM1, CX, Palo
Version: TM1 8.3 onwards
Excel Version: 2003 onwards
Contact:

Re: ExecuteProcess with too few parameters supplied

Post by Harvey »

I think this behaviour is correct. You can't specify parameters that don't exist, so 1 and 2 are definitely an error.

Omitting parameters is the only way to indicate to the ExecuteProcess command that you would like to use the defaults, so if that caused an error it would be very annoying.

Having written detailed TI libraries, I use that feature frequently, and need it to be available to users of my library. If they had to specify every parameter every time, it would get unwieldy. This would probably tilt my design toward minimizing parameters instead of maximizing features and flexibility.
Take your TM1 experience to the next level - TM1Innovators.net
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ExecuteProcess with too few parameters supplied

Post by Wim Gielis »

Thank you for your comments! :-)
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Darkhorse
Posts: 141
Joined: Wed Mar 09, 2011 1:25 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2003 2007 2010 2013

Re: ExecuteProcess with too few parameters supplied

Post by Darkhorse »

Lazarus wrote:I think this behaviour is correct. You can't specify parameters that don't exist, so 1 and 2 are definitely an error.

Omitting parameters is the only way to indicate to the ExecuteProcess command that you would like to use the defaults, so if that caused an error it would be very annoying.

Having written detailed TI libraries, I use that feature frequently, and need it to be available to users of my library. If they had to specify every parameter every time, it would get unwieldy. This would probably tilt my design toward minimizing parameters instead of maximizing features and flexibility.
Could you not right the, as static variables within the prologue rather than use parameters that can be altered if ran by the user?

I too feel the lack of warning when not specifying all is annoying it only takes one mistake to mess up a huge amount of data and these are the easiest ones to make.
dwigsy
Posts: 4
Joined: Thu Oct 09, 2008 4:34 am
OLAP Product: Cognos Express
Version: 10.1
Excel Version: Excel 2010
Location: Sydney

Re: ExecuteProcess with too few parameters supplied

Post by dwigsy »

I used to think that you would need to supply all of the parameters too until I discovered this recently. I think its useful to have the ability to use default values and override only those which you need.
User avatar
Harvey
Community Contributor
Posts: 236
Joined: Mon Aug 04, 2008 4:43 am
OLAP Product: PA, TM1, CX, Palo
Version: TM1 8.3 onwards
Excel Version: 2003 onwards
Contact:

Re: ExecuteProcess with too few parameters supplied

Post by Harvey »

Darkhorse wrote:Could you not right the, as static variables within the prologue rather than use parameters that can be altered if ran by the user?
The whole point of a library is to allow the user to alter the parameters, so that's not an issue. Note that these are reusable modular TI processes intended for the most part to be called from other processes. They are not likely to be run directly by end users.

I did at one point have a cube that provided default parameter and other values that could be changed, but I designed it such that, if the cube didn't exist, the TIs would still function with static defaults. I haven't found it worth the overhead for deployment to include the cube so far.
Take your TM1 experience to the next level - TM1Innovators.net
jstrygner
MVP
Posts: 195
Joined: Wed Jul 22, 2009 10:35 pm
OLAP Product: TM1
Version: 9.5.2 FP3
Excel Version: 2010

Re: ExecuteProcess with too few parameters supplied

Post by jstrygner »

Bringing up a bit older thread but found no comment about a thing I think is crucial.

I also think taking defaults in case parameter is not specifically called is a good practice.
Of course you need to be aware changing defaults may cause a bit mess.

But this becomes crucial if for any reason you decide to introduce new parameter to the TI that is called from other processes.
This new parameter is usually set by default to an option that would not change anything in the sub-process so-far behavior and this will make any other "caller" processes to work without issues which I would see as desired.

I think a very nice example is introducing Bedrock 2.0 processes that sometimes take advantage of this behavior.
java_to_tm1
Posts: 33
Joined: Mon Sep 23, 2013 3:24 pm
OLAP Product: TM1
Version: 10.2
Excel Version: Excel 2010

Re: ExecuteProcess with too few parameters supplied

Post by java_to_tm1 »

I LOVE this behavior in TM1 Execute Process.
Without this, I would never EVER add a new parameter to an existing process. The list of places (Cognos Insight button, Excel worksheets action buttons, other TI processes, command line batch files in 10.2) from where processes could be called is endless.
Finding (and then fixing) every one of these a logisitcal nightmare (for both developemnt and testing).

If IBM ever changes this behavior of ExecuteProcess, I'll remove all parameters from all Processes and simply pull these parameters from a cube.
The Java_to_TM1 Convert
TM1 Version 10.1, 10.2, Cognos Insight 10.1, 10.2
Local: Windows 7 Professional, Excel 2007
Server: Windows Server 2008 64-bit
p.s. I have a healthy disregard for Performance Muddler.
iansdigby
Community Contributor
Posts: 109
Joined: Thu Feb 26, 2009 8:44 am
OLAP Product: TM1
Version: 9 + 10 + Plan An
Excel Version: All
Location: Isle of Wight, UK

Re: ExecuteProcess with too few parameters supplied

Post by iansdigby »

java_to_tm1 wrote:I LOVE this behavior in TM1 Execute Process.
Without this, I would never EVER add a new parameter to an existing process. The list of places (Cognos Insight button, Excel worksheets action buttons, other TI processes, command line batch files in 10.2) from where processes could be called is endless.
Finding (and then fixing) every one of these a logisitcal nightmare (for both developemnt and testing).

If IBM ever changes this behavior of ExecuteProcess, I'll remove all parameters from all Processes and simply pull these parameters from a cube.
I thoroughly agree with this.
"the earth is but one country, and mankind its citizens" - Baha'u'llah
Post Reply