Page 1 of 1

TM1ProcessChoresUsing

Posted: Tue May 10, 2011 3:46 pm
by bagovino
This is probably a long shot since not a lot of people use the API, but I figured I'd ask in case someone actually knows the answer to this.

I'm trying to see what Chores a given Process is a step in and I came across the TM1ProcessChoresUsing() property function in the API. It looked to me as if it could be used to get a list of Chore handles that use a particular process, but if I try using that property with ObjectPropertyGet for any Process it just returns an error, ObjectPropertyNotFound if I remember correctly. I've tried using it with a Chore handle instead of a Process handle and I get the same results. As a work around I just loop over every Chore on a server and look at the array that stores the Process names for each of its steps, but I was hoping for something a little more... elegant. Has anyone ever used TM1ProcessChoresUsing() with success?

Thanks.

Re: TM1ProcessChoresUsing

Posted: Tue May 10, 2011 7:23 pm
by lotsaram
A file system search is pretty effective and pretty fast.
.cho files are simple text files and contain the names of the component processes.

Re: TM1ProcessChoresUsing

Posted: Tue May 10, 2011 8:03 pm
by bagovino
Thanks for the suggestion, but directly accessing the chore files on the disk is not applicable to what my application does. It actually doesn't have any access to the file system on the server running TM1.

Re: TM1ProcessChoresUsing

Posted: Wed May 11, 2011 8:58 am
by David Usherwood
But TM1 does :)
So write a TI to read the .cho files.
Or, of course, spend much longer digging into the badly documented and obscure API. Your call.

Re: TM1ProcessChoresUsing

Posted: Wed May 11, 2011 2:03 pm
by bagovino
It's a program that replicates processes from one instance to another without having to bounce the instance. I'd rather it not go around creating and deleting objects (any more than necessary) on the destination instance.

The program itself works fine already, and looping over the chores and looking at their steps in the API doesn't take long; I was just hoping there might be a cleaner way of seeing which chores I have to worry about through the API.

Re: TM1ProcessChoresUsing

Posted: Wed May 11, 2011 6:05 pm
by lotsaram
bagovino wrote:It's a program that replicates processes from one instance to another without having to bounce the instance. I'd rather it not go around creating and deleting objects (any more than necessary) on the destination instance.

The program itself works fine already, and looping over the chores and looking at their steps in the API doesn't take long; I was just hoping there might be a cleaner way of seeing which chores I have to worry about through the API.
I'm interested as this would be useful. But isn't there a product that does this already?

Re: TM1ProcessChoresUsing

Posted: Wed May 11, 2011 6:44 pm
by bagovino
I think there is, but being the curious and do-it-myself guy that I am I decided to see if I could figure it out how make my own. :)