Page 1 of 1

Unable to ViewZeroOut }bedrock.cube.view.create

Posted: Sat Nov 11, 2023 6:26 pm
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.

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

Posted: Sat Nov 11, 2023 7:14 pm
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.

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

Posted: Tue Nov 14, 2023 9:32 am
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.

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

Posted: Tue Nov 14, 2023 10:19 am
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.