Tm1-ui-process - run function on completion


#1

Is it possible to run a javascript function when the process executed via tm1-ui-process directive ends?


#2

Hi @aeremenko,

Since you are running a JavaScript function after that, you can run it via $tm1Ui service instead, and call a number of functions afterwards.

And just in case, here is an example:

$tm1Ui.processExecute('dev', 'Bedrock.Dim.Create', 'pDimension', 'My New Dimension').then(function(data){
	console.debug('Run (Bedrock.Dim.Create) %o', data);
	if(data.success){
		// process successfully ran
	}
	else{
		// process failed
	}
});

Any particular reason for running a function via tm1-ui-process vs exposing a button and running via $tm1Ui.processExecute()?


Paul


#3

It was an existing application. So I would have to rewrite all existing buttons, plus handle response behavior.
In this case, I managed to do this with $watch to check when the processes ends.


#4

Hi @aeremenko,

I see. Anyways, just send a ticket for this and we will check and assess from there.

Cheers!
Paul