Deactivating chores in Architect takes time

Ideas and tips for enhancing your TM1 application
Post Reply
Wim Gielis
MVP
Posts: 1846
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Deactivating chores in Architect takes time

Post by Wim Gielis » Thu Nov 01, 2018 7:52 pm

Hello all,

Last weekend I had to change a good number of chores in a rather big TM1 model, because of the clock that is reset 1 hour.
By doing that (in Architect) we have to deactivate the chore first, then change the settings, and activate the chore again.
Deactivating a chore can take a lot of time. I figured that this is because the whole tree of applications, cubes, dimensions, processes, chores, replications (which I always hide) is refreshed. It happens to be the case that in this model with a lot of objects (about 1,000 TI processes to name just 1 thing) refreshing the tree takes about half a minute or more. Pressing F5 also, because it's the same action.

Deactivating a chore is instantaneous if you first hide in the menu bar all objects except chores. In that case, very few objects are to be refreshed and hence it's quick. When you're done with the chores, make the objects visible again and you should be good.

On a related note, if anyone has a (free) utility with the REST API to change all/selected chore times with 1 hour (earlier or later) I would be very grateful !

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

David Usherwood
Site Admin
Posts: 1337
Joined: Wed May 28, 2008 9:09 am

Re: Deactivating chores in Architect takes time

Post by David Usherwood » Fri Nov 02, 2018 2:17 pm

I sometimes feel like a stuck record promoting TM1PY, but one of Marius' examples does exactly that:
https://github.com/cubewise-code/TM1py- ... 20chore.py
To repeat the key code:

Code: Select all

with TM1Service(**config['tm1srv01']) as tm1:
    # Read chore:
    c = tm1.chores.get('real chore')
    # Update properties
    c.reschedule(minutes=-3)
    c._frequency = ChoreFrequency(days=7, hours=22, minutes=5, seconds=1)
    c._execution_mode = 'MultipleCommit'
    c.activate()
    # Update the TM1 chore
    tm1.chores.update(c)
    

User avatar
jim wood
Site Admin
Posts: 3617
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: TM1 10.2.2
Excel Version: 2007
Location: 1639 Route 10, Suite 107, Parsippany, NJ, USA
Contact:

Re: Deactivating chores in Architect takes time

Post by jim wood » Fri Nov 02, 2018 2:44 pm

Excellent, thanks David. Btw shouldn't that be a broken record? :D
Struggling through the quagmire of life to reach the other side of who knows where.
Application Consulting Group (ACG) TM1 Consulting
OS: Windows 10 64-bit. TM1 Version: 10.2.2

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

Re: Deactivating chores in Architect takes time

Post by Wim Gielis » Sat Nov 03, 2018 12:09 pm

Hi David,

Thank you. My question and your answer generated 2 new questions:
- would it be difficult to loop over chores ? Maybe also the active chores ?
- can we only use "c.reschedule(minutes=-1)" and not leave out the other statements (frequency, executionmode). These will not change anyway.
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

David Usherwood
Site Admin
Posts: 1337
Joined: Wed May 28, 2008 9:09 am

Re: Deactivating chores in Architect takes time

Post by David Usherwood » Sun Nov 04, 2018 7:59 am

It's Marius' (sample) code, not mine. I suggest you install Python and TM1PY and play around with it. My own view is that this is far and away the best way to use the REST API for most purposes. (I have made some progress with using TM1PY to integrate TM1 with PowerBI.)

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

Re: Deactivating chores in Architect takes time

Post by Wim Gielis » Sun Nov 04, 2018 10:05 am

Thank you David, I'll experiment when I get the time for it.
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

Edward Stuart
Community Contributor
Posts: 222
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Deactivating chores in Architect takes time

Post by Edward Stuart » Mon Nov 05, 2018 11:09 am

TM1PY, in my opinion, should be a starting point for anyone looking to get more involved with the REST Api.

That said, the challenge you have is re-setting chores according to Daily Saving Time. Handily enough one of the properties of a Chore in the REST Api is "DSTSensitive"

Below is Postman output of a GET request on https://<ServerName>:<PortNumber>/api/v1/Chores, I only have a single Chore in my Test system, this request would display all Chores in your model.

Code: Select all

{
    "@odata.context": "$metadata#Chores",
    "value": [
        {
            "@odata.etag": "W/\"5f9d4c8ff79b56ada8be83a9f434f3e12c961aa8\"",
            "Name": "TestChoreMyProcess",
            "StartTime": "2018-10-01T23:18:57Z",
            "DSTSensitive": false,
            "Active": false,
            "ExecutionMode": "SingleCommit",
            "Frequency": "P999DT00H00M00S",
            "Attributes": {
                "Caption": "TestChoreMyProcess"
            }
        }
    ]
}
The REST API documentation states that DSTSensitive is a Boolean operator
EntityType: Chore
Properties:
Name (Type: String)
StartTime (Type: DateTimeOffset)
DSTSensitive (Type: Boolean)
Active (Type: Boolean)
ExecutionMode (Type: ChoreExecutionMode)
Frequency (Type: Duration)
Attributes (Type: Attributes)
Depending on how you want to connect you could loop through all required Chores and set to True

lotsaram
MVP
Posts: 3148
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Deactivating chores in Architect takes time

Post by lotsaram » Mon Nov 05, 2018 12:35 pm

Edward Stuart wrote:
Mon Nov 05, 2018 11:09 am

The REST API documentation states that DSTSensitive is a Boolean operator
EntityType: Chore
Properties:
Name (Type: String)
StartTime (Type: DateTimeOffset)
DSTSensitive (Type: Boolean)
Active (Type: Boolean)
ExecutionMode (Type: ChoreExecutionMode)
Frequency (Type: Duration)
Attributes (Type: Attributes)
Depending on how you want to connect you could loop through all required Chores and set to True
Be aware however that there's a bug in the REST API where the DSTSensitive property is ignored when updating a chore and is always set to false.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.

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

Re: Deactivating chores in Architect takes time

Post by Wim Gielis » Wed Nov 07, 2018 8:22 am

Thanks Lotsaram, that saves us from spending time on figuring out something that will not work.
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

lotsaram
MVP
Posts: 3148
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Deactivating chores in Architect takes time

Post by lotsaram » Wed Nov 07, 2018 10:42 am

Wim Gielis wrote:
Wed Nov 07, 2018 8:22 am
Thanks Lotsaram, that saves us from spending time on figuring out something that will not work.
Using TM1Py to reschedule chores +/- 1 hour works like a charm.
It is just that the chores will still be scheduled in UTC and not local time due to the bug in the rest API
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.

Post Reply