feat(history): Migrate C7 external task logs to C8 job history records#1017
Draft
feat(history): Migrate C7 external task logs to C8 job history records#1017
Conversation
Co-authored-by: yanavasileva <[email protected]>
Co-authored-by: yanavasileva <[email protected]>
Copilot
AI
changed the title
[WIP] Migrate C7 external task logs to C8 job history
feat(history): Migrate C7 external task logs to C8 job history records
Feb 19, 2026
1 task
Contributor
|
@copilot Can you rebase, resolve conflicts and adjust your changes to match the new migrator changes on main? |
Co-authored-by: HeleneW-dot <[email protected]>
Contributor
Author
Done in commit
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements migration of Camunda 7
HistoricExternalTaskLogentries to Camunda 8JobDbModelrecords, completing the audit trail for external service task execution history.Description
New migration pipeline:
HistoricExternalTaskLog→JobDbModelExternalTaskTransformer– maps C7 external task log fields to C8 job fields:type(topic),worker,state(CREATED/FAILED/COMPLETED/CANCELED),kind=BPMN_ELEMENT,listenerEventType=UNSPECIFIED,retries,hasFailedWithRetriesLeft,errorMessage,creationTime/endTime(based on log type),processDefinitionId,elementId,tenantId,partitionIdExternalTaskMigrator– extendsHistoryEntityMigrator(the refactored base class) implementingfetchForMigrateHandler(),fetchForRetryHandler(), andgetType(); resolvesprocessInstanceKey,processDefinitionKey,rootProcessInstanceKey,elementInstanceKey; skips with reason when parent entities not yet migratedHISTORY_EXTERNAL_TASKtype added toIdKeyMapper(auto-included ingetHistoryTypes())External task incident
jobKeypopulationIncidentMigratornow resolvesjobKeyforexternalTask-type incidents by:externalTaskIdfromc7Incident.getConfiguration()retries == 0viac7Client.getFailureExternalTaskLog()dbClient.findC8KeyByC7IdAndType(..., HISTORY_EXTERNAL_TASK)SKIP_REASON_MISSING_JOB_REFERENCE)Migration order
External tasks are migrated after flow nodes (dependency:
elementInstanceKey) and before incidents (dependency: incidentjobKey):Supporting changes
C7Client:getHistoricExternalTaskLog(),getFailureExternalTaskLog(),fetchAndHandleHistoricExternalTaskLogs()C8Client:insertJob()wiring existingJobMapperbeanEntitySkippedException: addedHistoricExternalTaskLogconstructorC7Entity.of(HistoricExternalTaskLog): usesgetTimestamp()as creation timeBaseMigratorreplaced byHistoryEntityMigrator;HistoryMigratornow usesgetMigrators()list with automatic retry loop; all migrators updated accordinglyType of Change
Testing Checklist
Black-Box Testing Requirements
DbClient,IdKeyMapper,..impl..packages except logging constants)ArchitectureTestvalidates these rules)Test Coverage
HistoryExternalTaskTestcovers:jobKey,type,worker,kind,elementId,processDefinitionId,tenantId,state=COMPLETED,endTime,partitionIdstate=FAILED,errorMessage,retries,hasFailedWithRetriesLeft=trueArchitecture Compliance
Run architecture tests to ensure compliance:
mvn test -Dtest=ArchitectureTestIf architecture tests fail, refactor your tests to use:
LogCapturerfor log assertionscamundaClient.new*SearchRequest()for C8 queriesDocumentation
Checklist
Related Issues
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.