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 establish a connection to a QPR MEA (QPR Suite) instance, and call Web Service operations.
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.
# Create a 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 ==
To connect to QPR MEA, a MEA connection string needs to be created and stored as a [[Storing_Secrets_for_Scripts|secret]].
To connect to QPR MEA, the MEA connection string needs to be created and stored as a [[Storing_Secrets_for_Scripts|secret]].


The MEA connection string is a json object with following properties:
The MEA connection string is a json object with following properties:
* '''url''': URL to the webHttp endpoint of the QPR MEA Web Service to be connected to.
* '''url''': URL of the QPR MEA Web Service endpoint.
* '''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.
Line 14: Line 19:
</pre>
</pre>


Example to store secret:
<pre>
ProjectById(1).SetSecret("QprMea", "MeaConnection", `{ "url": "https://<hostname>/QPR/Portal/QPR.Isapi.dll/wsforward/MainService.svc/webHttp", "logOnName": "MyUser", "password": "MyPassword" }`);
</pre>
== 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.


https://kb.qpr.com/qpr2025-1/qpr_web_service.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",
    `Find("Account", Name)`,
    "name",
    "MaxCount=3"
  );
</pre>


=== CreateObject ===
=== CreateObject ===
Performs [CreateObject](https://kb.qpr.com/qpr2025-1/createobject2.html) function call.
Calls CreateObject and returns the MEA ID of the created object. More information: https://kb.qpr.com/qpr2025-1/createobject2.html.


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


Example: Connect to the configured QPR MEA and create a new top-level comment action.
<pre>
<pre>
ProjectByName("TestProject")
ProjectByName("TestProject")
Line 46: Line 67:
</pre>
</pre>


Connects to the configured QPR MEA and creates a new top-level comment-action.
=== DeleteObject ===
 
Calls DeleteObject. More information: https://kb.qpr.com/qpr2025-1/deleteobject2.html.
===DeleteObject ===
Performs DeleteObject function call (https://kb.qpr.com/qpr2025-1/deleteobject2.html).


Parameters:
Parameters:
  1. '''objectIds''': String / array of strings
* '''Object IDs''' (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.
      1. One or more MEA IDs of objects to be deleted.
* '''Options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
      2. If array is given, every array element specifies one ID of object to be deleted.
  2. '''options''': String
      1. Additional options for the query.
      2. See [supported options](https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options).
      3. Optional.
 
Returns _empty.


Example: Connect to the configured QPR MEA and delete an object.
<pre>
<pre>
ProjectByName("TestProject")
ProjectByName("TestProject")
Line 67: Line 80:
   .DeleteObject("PO.0.985518423");
   .DeleteObject("PO.0.985518423");
</pre>
</pre>
Connects to the configured QPR MEA and deletes object with ID PO.0.985518423.


=== GetAttribute ===
=== GetAttribute ===
Performs [GetAttributeAsString](https://kb.qpr.com/qpr2025-1/getattributeasstring.html) function call.
Calls GetAttribute and returns the value of given object attribute as a string. More information: https://kb.qpr.com/qpr2025-1/getattributeasstring.html.


Parameters:
Parameters:
* '''objectId''': String
* '''Object ID''' (String): MEA ID of an object from which the attribute is fetched.
      1. 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
* '''Options''' (String): Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
      1. Name of the attribute that is queried.
      2. See [supported attributes](https://kb.qpr.com/qpr2025-1/supported_parameters.html).
* '''options''': String
      1. Additional options for the query.
      2. See [supported options](https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options).
      3. Optional.
 
Returns the value of given object's attribute as a string.


Example: Returns the name of an object.
<pre>
<pre>
ProjectByName("TestProject")
ProjectByName("TestProject")
Line 94: Line 98:
   );
   );
</pre>
</pre>
Connects to the configured QPR MEA and returns the name of object identified by MEA object ID: PG.785401983.683494101.
=== QueryObjects ===
Performs [QueryObjects](https://kb.qpr.com/qpr2025-1/queryobjects.html) function call.
Parameters:
  1. query: String
      1. The actual query. For more information, see the [query syntax documentation](https://kb.qpr.com/qpr2025-1/query_syntax.html)
  4. attributes: String
      1. Comma-separated list of attributes that are included in the results.
      2. See [supported attributes](https://kb.qpr.com/qpr2025-1/supported_parameters.html).
  2. criteria: String
      1. Criteria used to filter the results by.
      2. See [criteria documentation](https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=globalparameters).
  3. sortBy: String
      1. Comma-separated list of attributes to sort the results by.
  4. options: String
      1. Additional options for the query.
      2. See [supported options](https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options).
      3. Optional.
Returns the result of the query as a hierarchical dictionary object (#48320#) following the hierarchy of ResultSet-object returned by QPR MEA.
<pre>
ProjectByName("TestProject")
  .CreateMeaConnection(#{"ConnectionStringKey": "MeaConnection"})
  .QueryObjects(
    "[PG.1374444994].Subprocess",
    "name, typename",
    `Find("Account", Name)`,
    "name",
    "MaxCount=3"
  );
</pre>
Connects to the configured QPR MEA and returns name and typename of all the subprocesses in model identified by MEA object id PG.1374444994 whose name contains text "Account". Results are ordered by name and only at most three results are returned.


=== SetAttribute ===
=== SetAttribute ===
Performs [SetAttribute](https://kb.qpr.com/qpr2025-1/setattribute.html) function call.
Calls SetAttribute to set an attribute value. More information: https://kb.qpr.com/qpr2025-1/setattribute.html.


Parameters:
Parameters:
  1. objectIds: String / array of strings
* '''Object IDs''' (String or String*): MEA ID of an object from which the attribute is fetched. If array is given, every array element specifies one ID.
      1. 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.
      2. If array is given, every array element specifies one ID.
* '''Value''' (String): Value to be set for given attribute.
  2. attribute: String
* '''Options''': Optional options for the query. See https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options.
      1. Name of the attribute that is queried.
      2. See [supported attributes](https://kb.qpr.com/qpr2025-1/supported_parameters.html).
      3. Attribute must be writeable.
  3. value: String
      1. Value to be set for given object's attribute.
  4. options: String
      1. Additional options for the query.
      2. See [supported options](https://kb.qpr.com/qpr2025-1/parameters_and_options.html?anchor=options).
      3. Optional.
3. Sets the value of the attribute.


Example: Change the name of a user to "ChangedUser".
<pre>
<pre>
ProjectByName("TestProject")
ProjectByName("TestProject")
Line 160: Line 118:
   );
   );
</pre>
</pre>
Connects to the configured QPR MEA and changes the name of the user identified by MEA object ID: UM.0.123 to "ChangedUser".

Latest revision as of 22:31, 9 April 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.

Example connection string:

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

Example to store secret:

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",
    `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*): 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"
  );

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"
  );