Unable to ViewZeroOut }bedrock.cube.view.create

Post Reply
ConnorHoward
Posts: 2
Joined: Fri Sep 15, 2023 11:20 am
OLAP Product: TM1
Version: 11-0-8
Excel Version: 2019

Unable to ViewZeroOut }bedrock.cube.view.create

Post by ConnorHoward »

Hi,

I am having an issue with the bedrock.cube.view.create where it cannot be seen from within a process that is calling it. The example below is a ViewZeroOut but I have a similar one when assigning the view as a datasource. I just wondered if it something anyone has come accross before or if I am doing something wrong?

Environment: PAW 2.080

Bedrock VersionL: 4.0

Issue: Unable to ViewZeroOut a view that was created when calling '}bedrock.cube.view.create' within the same process.

Code:

Code: Select all

vSlice = 'DR CR Reclass';
vLedger = 'Actual';
vTime = '2023001';

pView =  'GLMain_Bedrock_Test_VZO';
pCube = 'GLMAIN';
pFilter = 'Slice¦' | vSlice | '&Ledger¦' | vLedger | '&Time¦' | vTime ;
pTemp = 1; 
pSuppressConsol = 1;

RunProcess( '}bedrock.cube.view.create', 'pView', pView, 'pCube' , pCube, 'pFilter' , pFilter, 'pTemp', pTemp, 'pFilter', pFilter, 'pSuppressConsol', pSuppressConsol);
 
  
ViewZeroOut(pCube, pView);
Error:

Prolog procedure line (25): View "GLMain_Bedrock_Test_VZO" in cube "GLMAIN" not found.
declanr
MVP
Posts: 1815
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: Unable to ViewZeroOut }bedrock.cube.view.create

Post by declanr »

I haven’t used the bedrock processes before but looking at the parameters you are passing a 1 to a “temp” parameter.
So most likely this is creating the views as temporary views which get destroyed at the end of the thread.

In the earliest release that included the temp option it could only be used in the one process before being destroyed again; in later releases they have made the temp objects available across a chain of processes.

However you are calling the bedrock process with the RunProcess function which actually initiates a complete separate thread for that process (it also doesn’t wait for it to complete) - if you change RunProcess to ExecuteProcess it will be within the same thread/chain and I expect that may resolve your issue.
Declan Rodger
lotsaram
MVP
Posts: 3654
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Unable to ViewZeroOut }bedrock.cube.view.create

Post by lotsaram »

Declan's answer is correct. You need to use ExecuteProcess not RunProcess.

1. So that all processes will be part of the same commit transaction, which makes temp objects accessible to other processes whihc are part of the same transaction.

2. So that the execution is serial and the calling process waits for the called process to complete. Even if you were creating permanent public views and subsets this would still fail using RunProcess as there wouldn't be sufficient time for the objects to be created and registered on the server before the calling process attempted to use them.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
ConnorHoward
Posts: 2
Joined: Fri Sep 15, 2023 11:20 am
OLAP Product: TM1
Version: 11-0-8
Excel Version: 2019

Re: Unable to ViewZeroOut }bedrock.cube.view.create

Post by ConnorHoward »

Thank you both for your help here. I am new to TM1 and definitely felt I was doing something incorrectly.

Creating the view as permanent was failing, as you both say, so I was scratching my head. However, the difference between RunProcess and ExecuteProcess makes perfect sense.

Thank you both once again.
Post Reply