COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => COGNOS Planning => Topic started by: kulkarni on 16 Jul 2009 10:52:54 AM

Title: What happens when we hit "Execute" button in CAC?
Post by: kulkarni on 16 Jul 2009 10:52:54 AM
I am curious to understand how CAC works  :).  As a starter, I thought of understanding how it is able to execute a macro, when we hit the 'Execute' button.

Has anyone ever explored this feature ???  Would you know what happens when 'Execute' button is clicked?

Thank you!
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: cognos775 on 16 Jul 2009 02:43:46 PM
Would you know what happens when 'Execute' button is clicked?

Yes, it will run that macro...
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: kulkarni on 16 Jul 2009 03:06:35 PM
Quote from: cognos775 on 16 Jul 2009 02:43:46 PM
Yes, it will run that macro...

Yes it's obvious that it will run the macro.  May be I should have been clearer when I asked it.

What I am interested in knowing is, what are all the activity that happens after clicking the button?  Let's say, we want to provide a button on our website that gives users ability to run the macro.  What I am interested in knowing is how to invoke the code that executes the macro?  Any ideas?
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: mrobby on 17 Jul 2009 11:07:47 AM
Here is how you can command line execute Planning Macros

Where you see epMacroExecutor.exe, just change to your local location on the server Contrib is installed.

Also, I believe you have to execute the command line on the server since you cant use //[server name] to target the epMacroExecutor.

Therefore you basically create a .bat file on the server with the command line below.  When you want to run a macro you execute the .bat file.


"D:\Program Files\Cognos\cer4\bin\epMacroExecutor.exe" /Macro=pad/[Your PAD Name Here]/macro/[Your Macro Name Here]
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: Gerald Donovan on 22 Jul 2009 07:37:01 AM
You can execute Contributor macros from Cognos Connection.

It's also possible (with a bit of hacking around), to create URL's that will execute macros directly. I've stuck such URL's in Contributor cube help-text before to enable end-users to run admin tasks remotely.

(Not saying this is a good thing to do of course - depends on the circumstances and requirements - but it can be done.)
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: kulkarni on 22 Jul 2009 03:18:49 PM
Robby, Thank you for the reply. Currently we have some batch files that execute contibutor macros in this fashion.  Actually, what I am interested in knowing is, series of action that gets carried out when "epMacro" exe is called.

Gerald,  can you please little bit more on how you managed to execute via URLs? Was it http url or something else.  This certainly sounds interesting  :)  Thank you.
Title: Re: What happens when we hit "Execute" button in CAC?
Post by: Gerald Donovan on 23 Jul 2009 06:14:02 AM
Quote from: kulkarni on 22 Jul 2009 03:18:49 PM
Gerald,  can you please little bit more on how you managed to execute via URLs? Was it http url or something else.  This certainly sounds interesting  :)  Thank you.

When you create a macro there is a check box that allows you to publish it to Cognos Connection. This creates an entry under Cognos>Administration>Planning>Macros.

You can now use this entry in a job, so that you can execute the macro from Cognos Connection, but at this stage, you have to go into Cognos Connection to run it, because a URL isn't created.

I don't really know much about Cognos Connection, so possibly the next bit could be done more easily, but...

Navigate to the job and click on the set properties icon, then select "view the search path, ID and URL" hyperlink. Notice that there is no URL, but all the parameters needed to create a URL that will run the job are contained within the search path.

As an example, on my demo image, this search path:

CAMID("CognosDemo - Series 7:u:authid=1315690924")/folder[@name='My Folders']/folder[@name='Testing']/jobDefinition[@name='Test BUTD']

Can be used to create this URL:


http://cognosdemo:80/cognos8/cgi-bin/cognos.cgi?b_action=dis.run&m_obj=CAMID%28%22CognosDemo%20%2D%20Series%207%3Au%3Aauthid%3D1315690924%22%29%2Ffolder%5b%40name%3d%27My%20Folders%27%5d%2ffolder%5b%40name%3d%27Testing%27%5d%2fjobDefinition%5b%40name%3d%27Test%20BUTD%27%5d


It looks a lot more complicated than it really is simply because of the conversion of necessary characters to ASCII codes in order to create a valid URL.