Import of standalone tasks cause NPEs due to missing flownodeID #4735
Labels
group:support
All requests that are linked to a customer request. DRI: Tassilo
potential:7.21.7
potential:7.22.2
scope:core-api
Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI
type:bug
Issues that describe a user-facing bug in the project.
version:7.23.0
Environment (Required on creation)
Optimize 7
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)
During import of flownode data for standalone tasks, Optimize importer throws an exception because the flownodeID is null when it is expected to be non null. For more details please refer to the support ticket.
Steps to reproduce (Required on creation)
Observed Behavior (Required on creation)
Exception during import:
Expected behavior (Required on creation)
No exception during import.
Root Cause (Required on prioritization)
Standalone tasks have no flownodeID (activitiyInstanceID) in the engine, but Optimize ctor has NonNull annotation for this field.
Solution Ideas
For now, lets just focus on removing the exception rather than adding the ability to Optimize to import standalone tasks in a way that makes them usable for report analysis.
Some potential approaches detailed here. Specifically, we could consider these two options (or a suitable alternative):
Option 1.: Optimize removes the @nonnull restraint on Flownode ID and imports this data regardlessThis would avoid the exception and the need to the manual workaround. However, Optimize would then keep flownode
data that is not very useful for reporting since the ID is missing so Optimize can for example not aggregate this flownode
data for flownode reports. I would also need to have a closer look at all our flownode import pipelines to determine if
Optimize would keep multiple entries, or overwrite one entry per standalone usertask import. In general, I think we should
avoid importing data that will not be useful for report analysis but it could be a quick "fix".
Option 2.: Optimize keeps the @nonnull restraint on Flownode ID but skips importing flownodes with no ID
Since the flownode data without ID is of limited use to Optimize reporting, we could also consider skipping the import of
usertask data that comes from the engine without an ID. This would mean there is no data in Optimize for standalone
tasks (unless other related data, like identity link logs, are imported.). Same as with Option 1, standalone tasks would also
not be available for report analysis, but at least we would avoid importing unnecessary data.
Current tendency: option 2 as it avoids unnecessary data import. However, need to double check if there are use cases where option 1 would be preferred or where option 2 doesnt work.
After discussion and getting more context on what standalone tasks are, we decided that there is no value in importing these to Optimize. Therefore, we should go for option 2 above or the following Option 3:
Option 3: Engine filters out standalone tasks on Optimize API
When Optimize fetches data for flownodes (/usertasks), the engine api only returns data for non standalone tasks so that Optimize does not need to do any additional filtering during its import. This could potentially be a more performant solution.
Hints
Workaround (test on lower environment first)
Workaround 1. Disable standalone tasks in the engine.
Workaround 2. Remove history related to standalone tasks
Workaround 3. Set a default placeholder (e.g.:
workaroundStandaloneTasks
) toTASK_DEF_KEY
,ACT_INST_ID
, inACT_HI_TASKINST
table. IfPROC_DEF_KEY_
andPROC_DEF_ID_
are null, populate them as well.Links
https://jira.camunda.com/browse/SUPPORT-24021
Breakdown
Pull Requests
Dev2QA handover
The text was updated successfully, but these errors were encountered: