Page 1 of 1

Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 1:59 pm
by ViRa
Hi,

I want to trigger a vb script that generates email upon an user submitting a node in TM1 Applications. So far, I was able to do this by use of an Action button that triggers a TI process which in turn executes the vb script (by using ExecuteCommand TI function).

However, I wish to auto trigger this script when the user hits the 'Submit' icon on TM1 Applications for a node. The approach I planned is -
- verify the status of 'OverlayData' element in '}SecurityOverlay' dimension available within '}SecurtyOverlayGlobal_<application name>' control cube
- When the status changes to '1' (after submitting a node), the vb script should be triggered automatically.

To achieve the above, I couldn't find the option to execute a command in Rules Editor.

Could anyone please guide me if there is a way to auto-trigger a command from Rules editor or is TI the only way to trigger?

Appreciate your help and time.

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 2:16 pm
by sander
Hi, which version are you on? I know in 10.2 there is new functionality, like sending e-mail notifications that are workflow driven and you can trigger TI's based on workflow actions.

http://blog.tm1tutorials.com/2013/09/20 ... processes/

http://pic.dhe.ibm.com/infocenter/ctm1/ ... tions.html

Haven't worked with it yet, so you have to find out for yourself.

Regards Sander

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 2:21 pm
by ViRa
Hi Sander,

I'm on 10.1.1. Yes, I read that in 10.2 this feature is automated. However, we dont plan to migrate to 10.2 anytime soon and I need to implement this featuer in 10.1.1.

Thanks

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 2:28 pm
by sander
I don't think you can trigger a TI process from a rule. What you can do is set some values in a 'variables' cube and you can schedule a chore (periodic, every few minutes) with TI's in it which looks at this variables and takes action based on this variables. There are more than enough examples on this forum.

Regards Sander

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 2:57 pm
by ViRa
Sander, you mean I can try scheduling a chore with TI that checks the status of }SecurityOverlayGlobal control cube and trigger the script accordingly. Please let me know if my understanding is correct.

Thanks

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 3:13 pm
by sander
That's an option, you have to store the old values somewhere to track if there are any changes. In the cube }tp_application_state}{[app number]} is more detailed info about app states, I think you'd better look there.

Regards Sander

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 3:51 pm
by ViRa
Sander, sorry to bother you with too many questions. But could you please guide me on how to track the changes? I did submit a node and verified that the 'State' changes in }tp_application_state}{[app number]} control cube on submission. Now using Rules Editor, if I compare the old values with the new ones, I would like the Vb script to be executed. Here is where I'm stuck.

Similarly, I'm not sure if I can track the changes in the old and new values using a TI process. If possible in TI, I can write an 'If' condition to track the changes in the values and trigger the 'ExecuteCommnd' function to run the vb Script.

Could you please guide me on what I'm missing?

Thanks

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 4:14 pm
by sander
1. Create a Cube or dimension where you can store the 'old values', if you do it with a dimension use attributes
2. Create a process that loops throug the }tp_application_state}{[app number]} cube and compare the values with the saved values. If a state is changed you can trigger another process which sends an e-mail, if wanted you can send additional info which is hold in that cube. At the end of that process save the new states in the cube or dim created in step 1.

No rules needed.

Regards Sander

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 5:44 pm
by ViRa
sander wrote: Create a process that loops throug the }tp_application_state}{[app number]} cube
Sander, I tried all this while on how to loop through a control cube value in TI process but could not find any TI function that does this. I have worked previously on coding for a control cube in a Rules Editor but never on TI. I'd really appreciate your time and efforts if you could please guide me on verifying a value from a controlcube in a Turbo Integrator process.

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 6:26 pm
by ViRa
Can anybody please guide me on looping through a control cube in a TI process? Appreciate your help.

Re: Auto Trigger a command in Rules Editor

Posted: Thu Nov 14, 2013 8:00 pm
by ViRa
Thanks Sander, I just kept pondering on your suggestion and got the solution :idea:
I used the CellGetS function to retrieve the value and store it in a variable and used the If condition to compare. I then sheduled a chore to trigger this TI.
The only problem now I have is this TI gets triggered as per the chore schedule. As a result, the mail gets triggered again and again.
I will use Chorequit; to work on this.

Appriciate your time. If you have any more suggestions, please let me know.

Thanks

Re: Auto Trigger a command in Rules Editor

Posted: Sat Nov 16, 2013 12:10 am
by Darkhorse
I use this methodology on a daily basis within 10.1

I run a top line value to a pl that no one can see called chkpl and in my regions and customers I have chkreg and checkcus this gives me an nth level in the cube to get a comparison against the real hierarchies

I then just cellgetn my check values against my cellgetn real top values, then email the two values + var nice and easy.

It also allows you to break the checks a little so I could load top values to every customer but to chkreg and chkpl to get a customer breakdown,

Then loop through my customers and add each string to each other with a char(10) between for a new line giving me a nice list of customer toplines etc all in one variable to add to a string later on

Again can reverse so all customers using chkcus and every region .. Etc

Then just run a simple check statement if var is not 0 then just change a cvcheck variable from false to true.. Then in epilogue run a quick if check is true send mail plus string (you can just mail the var line again using a simple if when making the string) using executecommand( run ...)

Hope this helps

Re: Auto Trigger a command in Rules Editor

Posted: Mon Nov 18, 2013 2:21 pm
by ViRa
Thanks for the suggestion and guidance.