Determine whether a TI process exists

Suggest and discuss enhancements for TM1
Post Reply
Wim Gielis
MVP
Posts: 1782
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Determine whether a TI process exists

Post by Wim Gielis » Fri Jun 21, 2013 7:22 am

Hello all,

Quick question. In Turbo Integrator, we have CubeExists(), DimensionExists(), ViewExists(), SubsetExists().
Why not ProcessExists()? Although Dimix() will do as well, why not have a direct function?

Wim
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

User avatar
Alan Kirk
Site Admin
Posts: 5816
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: 9.5.2 64 bit moving to 10.2.2
Excel Version: 2010
Location: Sydney, Australia
Contact:

Re: Determine whether a TI process exists

Post by Alan Kirk » Fri Jun 21, 2013 11:53 am

Wim Gielis wrote: Quick question. In Turbo Integrator, we have CubeExists(), DimensionExists(), ViewExists(), SubsetExists().
Why not ProcessExists()? Although Dimix() will do as well, why not have a direct function?
That's a very good point; and also ProcessExists is the one which is actually needed more than most of the others since a process is the only TM1 object that I can think of which can be in one of three, not two, states. (Does not exist, exists but has compile errors, exists without compile errors. With every other type of object it either is or it ain't.) If you are trying to call another process, you certainly want to know which one of those three it is.

Yes, IMHO that one should certainly be introduced as a function which can return one of three, not two, values.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.

Duncan P
MVP
Posts: 587
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Determine whether a TI process exists

Post by Duncan P » Fri Jun 21, 2013 2:52 pm

Cube rules have the same set of characteristics and states. Similar functions for rules would probably be useful too. What would really do it for me though would be ProcessLoadFromFile. That would be sweet.

User avatar
Alan Kirk
Site Admin
Posts: 5816
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: 9.5.2 64 bit moving to 10.2.2
Excel Version: 2010
Location: Sydney, Australia
Contact:

Re: Determine whether a TI process exists

Post by Alan Kirk » Fri Jun 21, 2013 7:55 pm

Duncan P wrote:Cube rules have the same set of characteristics and states.
Quite so. I qualify my previous statement accordingly.
Duncan P wrote: Similar functions for rules would probably be useful too. What would really do it for me though would be ProcessLoadFromFile. That would be sweet.
It would indeed; it would be a dead easy way to do hot promotion. I suspect that Iboglix might argue, and not without some justification, that there would be a risk of loading corrupt code with such a function had the .pro file been manually monkeyed with rather than being created by the Editorsaurus or Muddler in a dev environment, but really that's no different to the current situation where .pro files can be put in a data directory to be loaded on restart. Overall I think that the advantages of your idea hugely outweigh any potential risks.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.

TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: Determine whether a TI process exists

Post by TrevorGoss » Tue Jul 29, 2014 2:14 pm

Hello Wim.

I know this is an old thread but I have a possible solution to your question.

You can find out if a process exists in a given server, by searching through the flat files of that server.

You use the WildCardFileSearch function and direct it at the data files of the relevant server.

My code below is a quick demo:

Code: Select all


vName = 'NameOfDesiredProcess';

Z = Relevant Drive

vWild =WildCardFileSearch('Z:\RelevantService\DataFilesOfService\' | vName |'.pro','');

ASCIIOUTPUT('Z:\YourChosenFile\vWild.txt',vWild);
the vName variable is given a process name, you then pass that variable through the WildCardFileSearch function, then you run the process.

You do not need an ASCIIOUTPUT, you can use the return value any way you like.

declanr
MVP
Posts: 1587
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Determine whether a TI process exists

Post by declanr » Tue Jul 29, 2014 5:16 pm

TrevorGoss wrote:Hello Wim.

I know this is an old thread but I have a possible solution to your question.

You can find out if a process exists in a given server, by searching through the flat files of that server.

You use the WildCardFileSearch function and direct it at the data files of the relevant server.

My code below is a quick demo:

Code: Select all


vName = 'NameOfDesiredProcess';

Z = Relevant Drive

vWild =WildCardFileSearch('Z:\RelevantService\DataFilesOfService\' | vName |'.pro','');

ASCIIOUTPUT('Z:\YourChosenFile\vWild.txt',vWild);
the vName variable is given a process name, you then pass that variable through the WildCardFileSearch function, then you run the process.

You do not need an ASCIIOUTPUT, you can use the return value any way you like.
Trevor,

As wim eluded to in his first post the easiest way to do this is a dimix on the }processes dimension, your code would also work but if I was to query the data directory I would use fileexists () as opposed to the wildcard function.

The point was just why on earth they put in CubeExists or DimensionExists and not ProcessExists functions.

TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: Determine whether a TI process exists

Post by TrevorGoss » Wed Jul 30, 2014 7:42 am

Declanr,

I agree, we have 3 different ways of doing it here, so a function called ProcessExists should be straight forward.

Thanks for your response.

Wim Gielis
MVP
Posts: 1782
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Determine whether a TI process exists

Post by Wim Gielis » Mon Feb 26, 2018 11:37 am

Follow up:

Code: Select all

ProcessExists
has been added recently to the TI functions.
Thank you IBM.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

tm123
Posts: 113
Joined: Thu Oct 23, 2014 10:15 pm
OLAP Product: tm1, cognos bi
Version: 10.2
Excel Version: 2010

Re: Determine whether a TI process exists

Post by tm123 » Wed May 02, 2018 1:32 pm

Wim Gielis wrote:
Mon Feb 26, 2018 11:37 am
Follow up:

Code: Select all

ProcessExists
has been added recently to the TI functions.
Thank you IBM.
It would be nice if they also added a TI Function to delete a TI Process (such as ProcessDestroy or ProcessDelete). I have some TI Processes that their names start with } (like control objects) and they cannot be deleted from Server Explorer so the only way is to delete the .pro file from Data folder

Wim Gielis
MVP
Posts: 1782
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Determine whether a TI process exists

Post by Wim Gielis » Wed May 02, 2018 3:55 pm

tm123 wrote:
Wed May 02, 2018 1:32 pm
Wim Gielis wrote:
Mon Feb 26, 2018 11:37 am
Follow up:

Code: Select all

ProcessExists
has been added recently to the TI functions.
Thank you IBM.
It would be nice if they also added a TI Function to delete a TI Process (such as ProcessDestroy or ProcessDelete). I have some TI Processes that their names start with } (like control objects) and they cannot be deleted from Server Explorer so the only way is to delete the .pro file from Data folder
Did you check AsciiDelete ? You will still have to bounce the server but at least deleting the pro file can be done with a process.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

Post Reply