Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos 8 -- automate Framework Manager

We recently had a query about how to automate the functionality of Framework Manager.  When you make a modification to your Framework Manager model you are generating a related .log.xml file that gets saved to your project folder.  You can use teh BMTScriptPlayer.exe to re-execute your action log, or you can create generic action logs that can be applied to several projects.

Here is an example from a sample project where we updated the parameter map. 

<?xml version="1.0" encoding="UTF-8" ?>
<bmtactionlog project="C:\FM Projects\ModelTest\Sales.cpf" templatedir="../templates/bmt/Cr1Model" timestamp="20070919140143053" user="Jack Black" version=" 2.0.1520.0"><transaction saved="false" seq="1" timestamp="20070919140204209"><action seq="1" type="SetActiveLocale"><inputparams><param seq="1" type="i18nstring"><value>en-us</value></param></inputparams><domchanges/><result success="t"><outputparams/></result></action></transaction><transaction saved="false" seq="3" timestamp="20070919140224647"><action seq="1" type="Create"><inputparams><param seq="1" type="integer"><value>15</value></param><param seq="2" type="handle"><mappingpath>parameterMap/[@hidden=true]</mappingpath><value>[].[parameterMaps].[_env]</value></param><param seq="3" type="i18nstring"><value> account.personalInfo.</value></param><param seq="4" type="integer"><value>1</value></param></inputparams><domchanges/><result success="t"><outputparams/></result></action><action seq="2" type="Modify"><inputparams><param seq="1" type="handle"><mappingpath>parameterMapEntry/key</mappingpath><value>/O/key[0]/O/[].[parameterMaps].[_env].[ account.personalInfo.]</value></param><param seq="2" type="i18nstring"><value>account.personalInfo.userId</value></param></inputparams><domchanges/><result success="t"><outputparams/></result></action></transaction></bmtactionlog>

 

 


Here are the steps to follow to create a script from the Framework Manager user interface:

1.  Ensure anonymous access is enabled.

2.  Open Framework Manager.

3.  Create a new project and import a data source.

4.  Perform any modifications to your model, for example, you could create a parameter map, specify object security etc...

5.  Select View Transaction History under the Project menu.

6.  Select the checkbox next to the <Project_Name>-xxxxxxxxxx-log transaction list entry.

7.  Click Save as Script.

8.  Name the script TestScript.xml and click Save.

9.  Click Close.

 

Here are the steps to follow to recreate the project you have just created above:

1.  From a Command Prompt window, browse to the <C8_LOCATION>\bin directory.

2.  Enter BmtScriptPlayer at the Command Prompt for a list of all the possible options.

3)  Enter the following at the command prompt:

BmtScriptPlayer -c c:\temp\test\TestProject.cpf -a c:\temp\TestScript.xml

where:

 BmtScriptPlayer is the Script Player application
 -c is the option to create a new project
 c:\temp\test\TestProject.cpf is the file path of the new project to be created
 -a is the option to specify which action log to apply
 c:\temp\TestScript.xml is the file path of the script to be applied

4)  You have now recreated the project with the changes made to the model.

The XML file can be edited to modify either the actions or the values passed to the Script Player.