QPR Knowledge Base 2015.1

Appendix A: Example Scripts

Appendix A: Example Scripts

Previous topic Next topic No directory for this topic  

Appendix A: Example Scripts

Previous topic Next topic Topic directory requires JavaScript Mail us feedback on this topic!  

This chapter describes the ready-made scripts that come with the QPR Suite 2015 installation package. Unless stated otherwise, the script files are located in pgscripts and scscripts subfolders under the C:\ProgramData\QPR Software\QPR 2015\2015.1\Clients folder. You can find more details and information (such as possible restrictions and latest changes) in the comments of the scripts themselves.

 

DISCLAIMER: The example scripts come without any warranty. These scripts are just examples of how things could be done, and therefore they should not be utilized as such but modified to meet your actual needs. You should always verify the functionality with a separate test model first and always take a backup copy of a model you are going to use scripts on!

 

 

QPR Metrics Scripts

 

Edit Model

This script can be used as a basis for creating shortcuts to server models.. The script connects to the QPR Metrics Server defined in the script and opens the model with the ID or model name provided in the script. This script is located in the C:\ProgramData\QPR Software\QPR 2015\2015.1\Servers\Templates\WAS\SC folder with the name model.qprmsc.

 

 

SCImportXML

Imports a scorecard with measures (or one measure) to the model. If the XML file has more than one measure to be exported then a new scorecard is created. If the XML file has only one measure then a new measure is created under selected scorecard or under selected measure.

 

How to use this script:

1.Open a model with QPR Metrics client.
2.Select one scorecard from the left side of  Scorecard Explorer or a measure from the right side of Scorecard Explorer
3.Right-click the scorecard or the measure to get the context-sensitive menu and select Run...
4.Select SCImportXML.qprmsc from the file list
5.Browse to the folder containing the import file and select it
6.Script imports the XML file and creates new elements.

 

 

SCExportXML

Exports selected scorecard with measures or one measure from the model to an XML file. The export file has the following format:

 

<BSC id="BSC21" name="USA Sales Office" symbol="SC21">

 <BSCElement elementType="Measure [Maximize]" id="MEA238" name="Market Share" symbol="MARKETSHARE" parentId="MEA236" parentSymbol="GROWTH" unit="Percentage (2 Decimals)" inCharge="CEO" periodLevel="Quarter" valueSetting="Cumulative - Maximize - AVG YTD" periodicAccumulation="Average (ignore missing values)" chartTemplate="Cumulative - Maximize - AVG YTD ver1">

         <Values>

 <Series name="Actual" symbol="ACT" inputType="Manual input" label="" unit="" periodicAccumulation="" formula="">

                         <Value periodName="Q1 2000" date="1.1.2000" value="4"/>

 

XML file's default path is the "My Documents" folder and the name is "'Scorecard's name'-'Optionally selected element's name'"

 

How to use this script:

1.Open a model with QPR Metrics client.
2.Select one scorecard from the left side of Scorecard Explorer or a measure from the right side of  Scorecard Explorer
3.Right-click the scorecard or the measure to get the context-sensitive menu and select Run...
4.Select SCExportXML.qprmsc from the file list
5.Enter path for export file, default path is "My Documents" directory
6.Script generates the XML file and shows the file name in a message box.

 

 

SCExportToPG

This script creates a new QPR Modeling Client model based on a selected scorecard and measures belonging to the scorecard. For each element in the scorecard a new activity with link to scorecard element is created. The name for the QPR Modeling Client model is the same as the scorecard's name and the model is saved as a server model.

 

How to use this script:

1.Make sure that QPR Modeling Client is installed and connection to QPR BizArchitecture Server is working.
2.Open a model with QPR Metrics client.
3.Select one scorecard from the left side of Scorecard Explorer
4.Right-click the scorecard to get the context-sensitive menu and select Run...
5.Select SCExportToPG.qprmsc from the file list
6.Script creates a new PG server model.

 

 

SCDisableCalculation

This script disables calculation for the model that is currently open. This speeds up modeling operations with larger models, but can cause inconsistency in the measure values. Full model recalculation is recommended always after re-enabling calculation.

 

1.Open a model with QPR Metrics client.
2.Select one scorecard from the left side of Scorecard Explorer or a measure from the right side of  Scorecard Explorer
3.Right-click the scorecard or the measure to get the context-sensitive menu and select Run...
4.Select SCDisableCalculation.qprmsc from the file list

 

 

SCEnableCalculation

This script enables calculation for the model that is currently open and asks whether the recalculate the whole model.

 

1.Open a model with QPR Metrics client.
2.Select one scorecard from the left side of Scorecard Explorer or a measure from the right side of  Scorecard Explorer
3.Right-click the scorecard or the measure to get the context-sensitive menu and select Run...
4.Select SCEnableCalculation.qprmsc from the file list
5.A question about recalculating the model is asked. Selecting Yes is recommended to ensure that the measure values are consistent.

 

 

SCExportToWord

This script exports a report of the model that is currently open to Microsoft Word. The script contains user-definable variables with which you can control how many periods before and after the current period are included in the report. Note that you can control which scorecards are included in the report to some extent, i.e. when the script is executed, the currently active scorecard and all of its child scorecards are included in the report. If the model itself is selected when running the script, all scorecards are included. To run the script, do the following:

 

1.Open a model with QPR Metrics client.

2.Go to the Home tab and select Run Script from the Tools group

3.Select SCExportToWord.qprmsc from the list

4.The report is opened to a new Microsoft Word window. Note that this can take some time.

 

Note that for optimal processing speed the Microsoft Word document to which the report is created should be kept minimized until the script is finished.

 

Note: For larger models the report can be hundreds or thousands of pages long and therefore it might a while to generate it. However, you can limit the amount of generated pages with the help of user-definable variables in the script.

 

 

QPR Modeling Client Scripts

 

Edit Model

This script can be used as a basis for creating shortcuts to server models.. The script connects to the QPR BizArchitecture Server defined in the script and opens the model with the ID or model name provided in the script. This script is located in the C:\ProgramData\QPR Software\QPR 2015\2015.1\Servers\Templates\WAS\PG folder with the name model.pmf.

 

 

PGExportToSC

Creates a similarly named new QPR Metrics model with measures from a QPR Modeling Client model. For each process step type element one measure is created to the QPR Metrics model.

 

How to use this script:

1.Open a model with QPR Modeling Client. Make sure that QPR Metrics client is installed and fully functional on the same workstation.

2.Go to the Home tab and select Run Script from the Tools group

3.Select PGExportToSC.pmf

4.Script uses the "My Documents" directory to export the model to XML and creates a new QPR Metrics model based on that.

 

 

PGExportToWord

This script exports a report of the model that is currently open to Microsoft Word. If you have a diagram selected when starting to run the script, you are asked whether you want to create the report for the diagram in question or for the whole model. The report is saved to your My Documents folder. To run the script, do the following:

 

1.Open a model with QPR Modeling Client

1.Go to the Home tab and select Run Script from the Tools group

2.Select PGExportToWord.pmf from the list

3.The report is saved into your My Documents folder and opened when the script is finished.

 

Note: For larger models the report can be hundreds or thousands of pages long and it might take a while to generate.

Also note: The script won't work if there are two similarly named element types, for example two Activity types with the same name but a different symbol.

 

 

PGExportToBPEL

This script exports the current PG BPMN model to BPEL XML + WSDL files.

 

1.Open or create a new BPMN model with QPR Modeling Client

2.Go to the Home tab and select Run Script from the Tools group

2.Select PGExportToBPEL.pmf from the list

3.Define the folder and file where you want to save the exported files.

4.The script performs the export and lists the created files.

 

 

PGXPDLImport

This script imports model elements and flows from an XPDL XML file to a QPR Modeling Client BPMN model. This script is designed to work with PG models based on the BPMN template.

 

1.Open or create a new BPMN model with QPR Modeling Client

2.Go to the Home tab and select Run Script from the Tools group

3.Select PGXPDLImport.pmf from the list

4.Browse for the XPDL file to be imported

5.The script performs the import and creates the model elements and flow

 

 

PGXPDLExport

This script exports a QPR Modeling Client BPMN model as XPDL 2.1 files. This script is designed to work with PG models based on the BPMN template.

 

1.Open or create a new BPMN model with QPR Modeling Client

2.Go to the Home tab and select Run Script from the Tools group

3.Select PGXPDLExport.pmf from the list

4.Define the name and location for the .xpdl file.

5.The script performs the export and lists the created files.

 

 

PGVisioImport

This script imports a MS Visio Basic or Cross Functional diagram drawing saved as XML.

 

1.Open or create a new model with QPR Modeling Client

2.Go to the Home tab and select Run Script from the Tools group

3.Select PGVisioImport.pmf from the list

4.Browse the desired Visio .vdx XML file to be imported

5.New model elements will be created and/or attribute values will be updated