Skip to content

[E-doc] [Clearance model] Fix bug that clearance model generate replicated log#7391

Open
gggdttt wants to merge 6 commits intomainfrom
private/wenjiefan/bug-605044-E-doc-WorkflowReponseGeneratedTwice
Open

[E-doc] [Clearance model] Fix bug that clearance model generate replicated log#7391
gggdttt wants to merge 6 commits intomainfrom
private/wenjiefan/bug-605044-E-doc-WorkflowReponseGeneratedTwice

Conversation

@gggdttt
Copy link
Contributor

@gggdttt gggdttt commented Mar 25, 2026

Summary

Work Item(s)

Fixes AB#605044

@gggdttt gggdttt requested a review from a team as a code owner March 25, 2026 13:10
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Mar 25, 2026
@github-actions github-actions bot added this to the Version 29.0 milestone Mar 25, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AL Documentation Audit

Documentation gaps were detected in the following apps:

  • E-Document-Core-Tests: 0% documentation coverage
  • E-Document-Core: 3% documentation coverage

To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.

wenjiefan added 4 commits March 25, 2026 17:04
EDocumentService.Get(WorkflowStepArgument."E-Document Service");

// If the E-Document has already been exported, skip re-exporting it.
if EDocServiceStatus.Get(EDocument."Entry No", EDocumentService.Code) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you want to reexport?
Is that possible.

Try post document: Then it gets exported, then you change some editable field on posted document, and want that change to reflect in the e-document. What do you do in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our fix is in EDocumentWorkFlowProcessing.ExportEDocument() — the workflow response handler. It only runs when the workflow engine automatically fires the Export response step. The skip logic prevents a duplicate within the same workflow execution, because CreateEDocument already pre-exports the document before the workflow fires its Export response.

Manual re-export ("Recreate Document" action on the E-Document page) calls EDocExport.Recreate()EDocExport.ExportEDocument() directly. This path never goes through the workflow processing layer, so the status check we added is never hit.

Manual Re-export (unaffected):
  Page Action "Recreate" -> EDocExport.Recreate() -> EDocExport.ExportEDocument() -> always executes

Workflow auto-trigger (what we fixed):
  Workflow Engine -> EDocumentWorkFlowProcessing.ExportEDocument() ->  [status check -> skip if already Exported]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Correct me if I misunderstand this function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants