Page 1 of 1

Determine whether a TI process exists

Posted: Fri Jun 21, 2013 7:22 am
by Wim Gielis
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

Re: Determine whether a TI process exists

Posted: Fri Jun 21, 2013 11:53 am
by Alan Kirk
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.

Re: Determine whether a TI process exists

Posted: Fri Jun 21, 2013 2:52 pm
by Duncan P
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.

Re: Determine whether a TI process exists

Posted: Fri Jun 21, 2013 7:55 pm
by Alan Kirk
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.

Re: Determine whether a TI process exists

Posted: Tue Jul 29, 2014 2:14 pm
by TrevorGoss
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.

Re: Determine whether a TI process exists

Posted: Tue Jul 29, 2014 5:16 pm
by declanr
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.

Re: Determine whether a TI process exists

Posted: Wed Jul 30, 2014 7:42 am
by TrevorGoss
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.

Re: Determine whether a TI process exists

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

Code: Select all

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

Re: Determine whether a TI process exists

Posted: Wed May 02, 2018 1:32 pm
by tm123
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

Re: Determine whether a TI process exists

Posted: Wed May 02, 2018 3:55 pm
by Wim Gielis
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.

Re: Determine whether a TI process exists

Posted: Fri Oct 26, 2018 11:37 am
by Wim Gielis
Or use the TM1 REST API to delete a process.