Closed venetrius closed 1 month ago
Due to replacing the runtime with the history query, some behavioral changes occur:
asyncBefore
/asyncAfter
task won't yield process instances with the activityIdIn
filter since no history has been produced yet.
activityIdIn
filter on the subprocess "activity". This is an edge case and is not possible for all sub-process setups. We were only able to reproduce this for the compensation scenario. We accept this behavior change. The alternative way to do this, which we think is more common for most of the users, is to filter for concrete flow nodes and not for subprocesses.
@gbetances089 There are 3 things to pay extra attention:
activityIdIn
filter has a few edge cases see commentprocessInstanceQuery
has been swapped to historicProcessInstanceQuery
in modify operation. Only incidentIdIn
& activityIdIn
filters are newly added to the API but all filter options has been swapped to use the historic API. /camunda/api/engine/engine/default/modification/executeAsync
) accepts historicProcessInstanceQuery param to select instances:
-- executeModification can also be called with historicProcessInstanceQuery param, it might worth to have some test for that as well.
-- Testing when Process Instances modifications are requested with a query
Tested on the 7.22.0 release candidate final
User Story (Required on creation)
When filtering for process instances to modify in cockpit modify workflow I want to be able to apply a filter to the
startDate
of the process instance.Functional Requirements (Required before implementation)
API:
incidentIdIn
filter is available onhistoricProcessInstanceQuery
activityIdIn
filter is available onhistoricProcessInstanceQuery
. It returns all non completed / deleted activity with an exception regarding :asyncBefore
/asyncAfter
andcompensation
. More about exception in this note/camunda/api/engine/engine/default/modification/executeAsync
) accepts historicProcessInstanceQuery param to select instancesClient - Cockpit
Swap processInstanceQuery to historicProcessInstanceQuery in modify operation Users can filter on
startDate
in process instance modify workflow. All the existing filters are working Saved filters are not shared between process instance modify workflow and other pages/workflows.Breakdown
Add
IncidentIdIn
filter toHistoricProcessInstanceQuery
Java API
incidentIdIn(String... incidentIds);
to theHistoricProcessInstanceQuery
APIincidentIds
with setter /getter toHistoricProcessInstanceQueryDto(impl)
SQL
incidentId
is available inACT_HI_INCIDENT
the logic to joinACT_HI_INCIDENT
is already present inHistoricProcessInstanceQuery
and only needed to be updated with a check on the new field.Code changes in `HistoricProcessInstance.xml`
```diff -Swap
processInstanceQuery
tohistoricProcessInstanceQuery
in modify operationUpdate instancesList.js to use historicProcessInstanceQuery
Code changes
```diff InstancesList.prototype.updatePage = function(resetSelection) { ... -self.delegate.api - .resource('process-instance') - .list(params, function(err, result) { - self.delegate.instances = result; - self.delegate.applySelection(); - checkLoading(); - }); - -self.delegate.api - .resource('process-instance') - .count(params, function(err, result) { - self.delegate.instancesCount = result.count; - checkLoading(); - }); + const HistoryResource = self.delegate.api.resource('history'); +HistoryResource.processInstance(params, function(err, result) { + self.delegate.instances = result; + self.delegate.applySelection(); + checkLoading(); +}); +HistoryResource.processInstanceCount(params, function(err, result) { + self.delegate.instancesCount = result.count; + checkLoading(); +}); ```Filter out finished instances
In instancesList.js add unfinished = true filter to all modify instances query to only show runtime instance and not finished or canceled ones
Update keys in filter configuration
Keys, values and available operators are defined in instances-search-config.json Keys are the filter names that are sent in a request, values are the labels that are visible for a customer.
Example:
Config for filtering by subprocess instance id ```js { "id": { "key": "subProcessInstanceId", "value": "PLGN_MOD_SEARCH_SUB_ID" }, "operators": [ { "key": "eq", "value": "=" } ] }, ``` What the users sees when filtering by subprocess instance idUpdate the key for the filters and leave the values unchanged so the users don't have to re-learn the filter names.
Update local storage key used to save modify queries
Update the
storage-group
in modification-confirmation-dialog.html from"'PI'"
to"'PIM'"
(Process Instance Modification)Limitations of Scope
Hints
Links
epic
Dev2QA handover