QPR MEA Integration: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
QPR ProcessAnalyzer is able to connect to a QPR MEA (QPR Suite) instance and call its Web Service operations. QPR MEA Web Service documentation: https://kb.qpr.com/qpr2025-1/qpr_web_service.html.
QPR ProcessAnalyzer is able to connect to a QPR MEA (QPR Suite) instance and call its Web Service operations. To use the MEA connection, the following steps are required:
 
# Create a connection string and store it as a secret.
To use the MEA connection, the following steps are required:
# Create a connection object.
# Create connection string and store the secret.
# Create connection object.
# Call web service operations using the connection object.
# Call web service operations using the connection object.


QPR MEA Web Service documentation: https://kb.qpr.com/qpr2025-1/qpr_web_service.html.


== MEA Connection String ==
== MEA Connection String ==
Line 14: Line 13:
* '''logOnName''': Log on name of the user who will access the QPR MEA Web Service.
* '''logOnName''': Log on name of the user who will access the QPR MEA Web Service.
* '''password''': User's password in QPR MEA.
* '''password''': User's password in QPR MEA.
All QPR ProcessAnalyzer users who have access to the project where the connection string is stored, can use the MEA connection. The MEA user permissions in the connection string determine what operations can be done in the MEA side. For security reasons, if the intention is only to fetch data, the read-only permissions are sufficient for the MEA user.


Example connection string:
Example connection string:
Line 20: Line 21:
</pre>
</pre>


Example to store the secret:
MEA connection strings can be stored using the [[Project_Properties_Dialog|Project Properties dialog]]. Alternatively the expression language [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#SetSecret|SetSecret function]] can be used as follows:
<pre>
<pre>
ProjectById(1).SetSecret("QprMea", "MeaConnection", `{ "url": "https://<hostname>/QPR/Portal/QPR.Isapi.dll/wsforward/MainService.svc/webHttp", "logOnName": "MyUser", "password": "MyPassword" }`);
ProjectById(1).SetSecret("QprMea", "MeaConnection", `{ "url": "https://<hostname>/QPR/Portal/QPR.Isapi.dll/wsforward/MainService.svc/webHttp", "logOnName": "MyUser", "password": "MyPassword" }`);
Line 26: Line 27:


== MEA Web Service Operations ==
== MEA Web Service Operations ==
=== QueryObjects ===
Calls QueryObjects and returns query results as a hierarchical dictionary. More information: https://kb.qpr.com/qpr2025-1/queryobjects.html.
Parameters:
* '''Query''' (String): Actual query. See https://kb.qpr.com/qpr2025-1/query_syntax.html.
* '''Attributes''' (String): Comma-separated list of attributes that are included in the results. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''Criteria''' (String): Results filtering criteria. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=globalparameters.
* '''Sort By''' (String): Comma-separated list of attributes for sorting results.
* '''Options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
Example: Return name and typename of all the subprocesses in a model whose name contains text "Account". Results are ordered by name and only at most three results are returned.
<pre>
ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .QueryObjects(
    "[PG.1374444994].Subprocess",
    "name, typename, isBpmnDiagram",
    `Find("Account", Name)`,
    "name",
    "MaxCount=3"
  );
</pre>
=== CreateObject ===
=== CreateObject ===
Calls CreateObject and returns the MEA ID of the created object. More information: https://kb.qpr.com/qpr2025-1/createobject2.html.
Calls CreateObject and returns the MEA ID of the created object. More information: https://kb.qpr.com/qpr2025-1/createobject2.html.


Parameters:
Parameters:
* '''namespaceId''' (String): MEA ID of the namespace into which the object is to be created.
* '''Namespace ID''' (String): MEA ID of the namespace into which the object is to be created.
* '''objectTypeName''' (String): Defines type of the new object.
* '''Object type name''' (String): Defines type of the new object.
* '''name''' (String): Defines name for the new object.
* '''Name''' (String): Defines name for the new object.
* '''parentIds''' (String or String*): MEA ID of parent object. If array is given, every array element specifies one ID.
* '''Parent IDs''' (String or String array): MEA ID of parent object. If array is given, every array element specifies one ID.
* '''attributes''' (Dictionary): Key/value pairs of <attribute>/<attribute value> to be set for the created object.
* '''Attributes''' (Dictionary): Key/value pairs of <attribute>/<attribute value> to be set for the created object.
* '''options''' (String): Optional options for the operation. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
* '''Options''' (String): Optional options for the operation. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.


Example: Connect to the configured QPR MEA and create a new top-level comment action.
Example: Connect to the configured QPR MEA and create a new top-level comment action.
Line 44: Line 69:
</pre>
</pre>


===DeleteObject ===
=== DeleteObject ===
Calls DeleteObject. More information: https://kb.qpr.com/qpr2025-1/deleteobject2.html.
Calls DeleteObject. More information: https://kb.qpr.com/qpr2025-1/deleteobject2.html.


Parameters:
Parameters:
* '''objectIds''' (String or String*): One or more MEA IDs of objects to be deleted. If array is given, every array element specifies one ID of object to be deleted.
* '''Object IDs''' (String or String array): One or more MEA IDs of objects to be deleted. If array is given, every array element specifies one ID of object to be deleted.
* '''options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
* '''Options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.


Example: Connect to the configured QPR MEA and delete an object.  
Example: Connect to the configured QPR MEA and delete an object.  
Line 62: Line 87:


Parameters:
Parameters:
* '''objectId''' (String):  MEA ID of an object from which the attribute is fetched.
* '''Object ID''' (String):  MEA ID of an object from which the attribute is fetched.
* '''attribute''' (String): Name of the attribute that is queried. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''Attribute''' (String): Name of the attribute that is queried. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
* '''Options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.


Example: Returns the name of an object.
Example: Returns the name of an object.
Line 76: Line 101:
</pre>
</pre>


=== QueryObjects ===
Example: Read BPMN XML 2.0 diagram from QPR ProcessDesigner.
Calls QueryObjects and returns query results as a hierarchical dictionary following the hierarchy of ResultSet object returned by QPR MEA. More information: https://kb.qpr.com/qpr2025-1/queryobjects.html
 
Parameters:
* '''query''' (String): The actual query. See https://kb.qpr.com/qpr2025-1/query_syntax.html.
* '''attributes''' (String): Comma-separated list of attributes that are included in the results. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''criteria''' (String): Criteria used to filter the results by. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=globalparameters.
* '''sortBy''' (String): Comma-separated list of attributes to sort the results by.
* '''options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
 
Example: Return name and typename of all the subprocesses in a model whose name contains text "Account". Results are ordered by name and only at most three results are returned.
<pre>
<pre>
ProjectByName("TestProject")
ProjectByName("TestProject")
   .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
   .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
   .QueryObjects(
   .GetAttribute(
     "[PG.1374444994].Subprocess",
     "[PG.123.456]",
    "name, typename",
     "bpmnxml"
    `Find("Account", Name)`,
    "name",
     "MaxCount=3"
   );
   );
</pre>
</pre>
Line 103: Line 115:


Parameters:
Parameters:
* '''objectIds''' (String or String*): MEA ID of an object from which the attribute is fetched. If array is given, every array element specifies one ID.
* '''Object IDs''' (String or String array): MEA ID of an object from which the attribute is fetched. If array is given, every array element specifies one ID.
* '''attribute''' (String): Name of the attribute that is queried. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''Attribute''' (String): Name of the attribute that is queried. See https://kb.qpr.com/qpr2025-1/supported_parameters.html.
* '''value''' (String): Value to be set for given attribute.
* '''Value''' (String): Value to be set for given attribute.
* '''options''':  Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
* '''Options''':  Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.


Example: Change the name of a user to "ChangedUser".
Example: Change the name of a user to "ChangedUser".
Line 116: Line 128:
     "name",
     "name",
     "ChangedUser"
     "ChangedUser"
  );
</pre>
Example: Save BPMN XML 2.0 diagram as the QPR ProcessDesigner diagram.
<pre>
ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .SetAttribute(
    "[PG.123.456]",
    "bpmnxml",
    "<?xml version='1.0' encoding='UTF-8'?>..."
   );
   );
</pre>
</pre>

Latest revision as of 08:09, 21 May 2026

QPR ProcessAnalyzer is able to connect to a QPR MEA (QPR Suite) instance and call its Web Service operations. To use the MEA connection, the following steps are required:

  1. Create a connection string and store it as a secret.
  2. Create a connection object.
  3. Call web service operations using the connection object.

QPR MEA Web Service documentation: https://kb.qpr.com/qpr2025-1/qpr_web_service.html.

MEA Connection String

To connect to QPR MEA, the MEA connection string needs to be created and stored as a secret.

The MEA connection string is a json object with following properties:

  • url: URL of the QPR MEA Web Service endpoint.
  • logOnName: Log on name of the user who will access the QPR MEA Web Service.
  • password: User's password in QPR MEA.

All QPR ProcessAnalyzer users who have access to the project where the connection string is stored, can use the MEA connection. The MEA user permissions in the connection string determine what operations can be done in the MEA side. For security reasons, if the intention is only to fetch data, the read-only permissions are sufficient for the MEA user.

Example connection string:

{ "url": "https://<hostname>/QPR/Portal/QPR.Isapi.dll/wsforward/MainService.svc/webHttp", "logOnName": "MyUser", "password": "MyPassword" }

MEA connection strings can be stored using the Project Properties dialog. Alternatively the expression language SetSecret function can be used as follows:

ProjectById(1).SetSecret("QprMea", "MeaConnection", `{ "url": "https://<hostname>/QPR/Portal/QPR.Isapi.dll/wsforward/MainService.svc/webHttp", "logOnName": "MyUser", "password": "MyPassword" }`);

MEA Web Service Operations

QueryObjects

Calls QueryObjects and returns query results as a hierarchical dictionary. More information: https://kb.qpr.com/qpr2025-1/queryobjects.html.

Parameters:

Example: Return name and typename of all the subprocesses in a model whose name contains text "Account". Results are ordered by name and only at most three results are returned.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .QueryObjects(
    "[PG.1374444994].Subprocess",
    "name, typename, isBpmnDiagram",
    `Find("Account", Name)`,
    "name",
    "MaxCount=3"
  );

CreateObject

Calls CreateObject and returns the MEA ID of the created object. More information: https://kb.qpr.com/qpr2025-1/createobject2.html.

Parameters:

  • Namespace ID (String): MEA ID of the namespace into which the object is to be created.
  • Object type name (String): Defines type of the new object.
  • Name (String): Defines name for the new object.
  • Parent IDs (String or String array): MEA ID of parent object. If array is given, every array element specifies one ID.
  • Attributes (Dictionary): Key/value pairs of <attribute>/<attribute value> to be set for the created object.
  • Options (String): Optional options for the operation. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.

Example: Connect to the configured QPR MEA and create a new top-level comment action.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .CreateObject("PO", "Comment", "Test comment", "", #{"description": "Test comment description"});

DeleteObject

Calls DeleteObject. More information: https://kb.qpr.com/qpr2025-1/deleteobject2.html.

Parameters:

Example: Connect to the configured QPR MEA and delete an object.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .DeleteObject("PO.0.985518423");

GetAttribute

Calls GetAttribute and returns the value of given object attribute as a string. More information: https://kb.qpr.com/qpr2025-1/getattributeasstring.html.

Parameters:

Example: Returns the name of an object.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .GetAttribute(
    "[PG.785401983.683494101]",
    "name"
  );

Example: Read BPMN XML 2.0 diagram from QPR ProcessDesigner.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .GetAttribute(
    "[PG.123.456]",
    "bpmnxml"
  );

SetAttribute

Calls SetAttribute to set an attribute value. More information: https://kb.qpr.com/qpr2025-1/setattribute.html.

Parameters:

Example: Change the name of a user to "ChangedUser".

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .SetAttribute(
    "[UM.0.123]",
    "name",
    "ChangedUser"
  );

Example: Save BPMN XML 2.0 diagram as the QPR ProcessDesigner diagram.

ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .SetAttribute(
    "[PG.123.456]",
    "bpmnxml",
    "<?xml version='1.0' encoding='UTF-8'?>..."
  );