Skip to main content

Earmark execution exceptions: background steps and Retry

This page is for administrators and finance managers who watch the work Earmark does by itself after a person or a posting has saved something. Earmark runs a number of follow-up steps (timeline rows, business events, automatic journal posts, mirror pairing, automatic pricing of order lines and others) only once the work that started them has committed, so a follow-up that fails can never refuse or undo that work. A follow-up that fails becomes one row on Earmark execution exceptions, where you fix the cause and select Retry selected, or close the row with Dismiss and a reason.

Runs: by itself, right after the transaction that offered the step commits; Retry selected and Dismiss run on demand. Set up by: Accounting manager (the switches and the retention period in Earmark parameters). Watched by: Accounting manager, Accounts receivable manager, Accounts payable manager.

Why it exists​

A sales packing slip, a deal approval or a claim approval is your business record. Earmark adds work around it: it writes the act to the timeline, tells other systems through business events, posts the journal it created, pairs the vendor side of a mirrored deal, prices an order line an integration created. If any of that ran inside the same transaction, a failure in Earmark's part (an endpoint that is down, a missing setup row, a locked record) would roll back the document that you meant to save.

So Earmark keeps these steps outside the transaction and makes each failure visible and recoverable instead:

  • the act that started the step stands exactly as it was saved;
  • the failure is a row with a company, an operation, the record it is about and a message;
  • every row can be retried by the handler that the operation ships with, and retrying cannot post money twice;
  • the workbench is shared by every company, so one person can triage the whole estate.

A refusal is different. When a deal's rules decide something (a cap is reached, a deal does not apply, an approver may not approve), that is a verdict: it is reported where it happened and never reaches this workbench. See Pricing and accruals: tell a verdict from a failure.

When it runs​

  • The background steps run by themselves. A step offered while a transaction is open waits for that transaction and runs right after it commits, in the same session and in the company it was offered in. If the transaction rolls back, the step is dropped and nothing is sent or written. A step offered when no transaction is open runs at once, in a separate session (an automatic journal post runs in the same session).
  • A workbench row is written the moment a step fails.
  • Retry selected and Dismiss run when someone selects them on Earmark execution exceptions.
  • Retention cleanup removes old closed rows on its own schedule; see Retention cleanup.

No batch job has to be scheduled for the background steps. Some of the work they hand on does depend on a batch job: a journal that could not be posted straight away is posted by the next Accrual event processor run; see Post automatically and Accrual event processor.

Settings​

SettingWhereDefaultEffect
Execution exception retention (days)Earmark > Setup > Earmark parameters, Retention tab90Resolved and Dismissed rows older than this are removed by the retention cleanup. Open and Retrying rows are never removed.
Publish deal events, Publish accrual events, Publish Earmark claim eventsEarmark parameters, Events tabYes, Yes, NoWhether the business event steps run at all. A switch that is off sends nothing and raises no row. See Earmark business events.
Inbound auto-pricingEarmark parameters, Price build-up tabNoWhether the Inbound price build step runs for sales lines created by an integration. See Inbound auto-pricing and headless auto-attach.
Headless auto-attach on purchase linesEarmark parameters, Vendor deals tabNoWhether the Headless purchase attach step runs for new purchase lines.
Customer deals, Vendor deals, Inventory deals and the deal shapesEarmark parameters, Modules tabOff as shippedA step that belongs to a module or shape that is off does not run. The workbench itself stays available whatever is switched off, so rows raised earlier can still be worked.
Applicable to EarmarkFinancial reasons pageNot selectedOnly reasons with this selected are offered and accepted by Dismiss.
Event processing modeEarmark parameters, Accrual processing tabImmediate and sweepDoes not change any step on this page: none of them has a sweep to fall back on, so each one runs whichever mode is chosen.

The settings are described in full in the configuration reference.

What it does​

  1. The work commits. A person, a posting or a batch job finishes an Earmark act or a document Earmark observes, in one transaction.
  2. The follow-up steps wait for the commit. Each step offered during the transaction is noted against it. Nothing is sent, posted or written for it yet.
  3. The steps run. After the commit, each step runs in the company it was offered in, inside its own error handling. A rolled-back transaction runs none of them.
  4. A failure becomes one row. If a step fails, Earmark writes an Open row to Earmark execution exceptions with the company, the operation, the source area, the source document type and record, a message and the person or batch user. The act from step 1 is not touched. If Publish deal events is on and the event is activated in the business events catalog, a row written outside any open transaction also sends Earmark execution exception created; a row written while a transaction is still open sends nothing.
  5. If even the row cannot be written (for example the database refuses it), no row appears and Earmark adds no message of its own: at most the database's own error shows in the infolog. The act from step 1 still stands, but the follow-up is neither done nor listed anywhere.
  6. Retry selected, for each selected row in turn:
    1. Refuses a row that is not Open or Retrying ("Execution exception ... cannot be retried because it is ..."), and a row that is already Retrying and was claimed less than 60 minutes ago ("Execution exception ... is already being retried by another session...").
    2. Claims the row: Exception status becomes Retrying, Retries goes up by one and Last attempt is stamped. The claim is saved before anything else happens.
    3. Runs the retry handler that the row's operation registered, in your current company (see When it fails for why that matters).
    4. Settles the row: Resolved when the handler reports the work done, Open when it does not. A row returned to Open this way also shows "No retry handler answered for operation ..., so the exception has been returned to Open...", even when a handler did answer and declined: read the handler's own message above it for the reason. If the handler throws, the row returns to Open and the infolog says "The retry of execution exception ... failed, so the row has been returned to Open and can be retried again once the cause is fixed...". If someone dismissed or retried the row in the meantime, the outcome is not written over theirs.
    5. Reports "Retried ... of ... selected execution exceptions. ... could not be completed and remain open."
  7. Dismiss asks for one Reason code for all the selected rows, refuses a reason that is blank or not flagged for Earmark before any row changes, and then sets each row that is still Open or Retrying to Dismissed with that Dismiss reason. It reports "Dismissed ... of ... selected execution exceptions. ... were refused."

Resolved and Dismissed are final. A row is never reopened; if the same failure happens again, a new row is raised.

Before it can run​

  • Nothing to schedule for the steps themselves.
  • The Exception ID number sequence in Earmark parameters numbers the rows. If it is missing, rows still get an id beginning with EX-, so no failure is lost.
  • Roles. Retry selected and Dismiss need the duty Process Earmark execution exceptions, held by the Accounting manager, the Accounts receivable manager and the Accounts payable manager (and the System administrator). Reading the workbench is open to those roles and to the Accounting supervisor, the Accountant, the Inventory accountant, the Accounts receivable clerk, the Accounts payable clerk, the Purchasing manager, the Sales clerk, the Sales manager, the Earmark auditor, the Earmark claims approver and the Earmark deal approver. Anyone else sees Retry selected and Dismiss disabled.
  • A reason flagged for Earmark before anyone can dismiss: select Applicable to Earmark on at least one financial reason.

What goes in and what comes out​

The background steps​

StepWhen it is offeredOperation on the workbench if it fails
Write a timeline rowEach recorded act on a deal, claim, movement or price buildTimeline write
Send a business eventEach act that has an event, while its switch is onEvent publish (deal, claim, price build-up and vendor events), Pulse emit (accrual events), License Pulse emit, Migration Pulse emit
Report open accruals and notify the deal ownerA deal is closed or abortedTerminal hook notify
Post a journal created for automatic postingAn accrual movement, or a vendor settlement run's claim, created a journal whose movement type posts automaticallyJournal post
Pair the vendor side of a mirrored dealA movement posts on a customer instance that a mirror funds, and after each event the accrual event processor finishesMirror vendor-side movement
Price a sales line an integration createdThe order commits, Inbound auto-pricing is on and a policy existsInbound price build
Attach a new purchase line to vendor dealsThe order commits and Headless auto-attach on purchase lines is onHeadless purchase attach
Attach a new sales line to inventory dealsThe order commits and Inventory deals is onInventory provision attach
Create the vendor accrual of a sales-triggered dealA sales price build commits and Sales-triggered vendor accrual is onThird-party attach create

Not every failure of the two automatic pricing steps reaches the workbench. Inbound price build and Headless purchase attach report an ordinary error while building the price as a verdict on the line, so such a line is left unpriced with no row to retry. Check new integration and purchase lines for a price build rather than relying on the workbench alone.

The workbench also receives failures from Earmark's batch jobs and dialogs (the accrual event processor, claim approval posting, claim statements, the vendor settlement run, migration, the setup checklist and the license check), so it lists every operation below.

Every operation and what Retry does​

Each row's Operation names the step that failed. Source area is the part of Earmark it belongs to, as the workbench shows it.

OperationSource areaWhat Retry selected doesWhy repeating it is safe
Event publishDealsRe-sends a deal event (submitted, approved, returned, canceled, closed, aborted) with its original event id and time, built from the deal as it is now. It looks the row's record up as a deal whatever the row's Source document type, so retry only a row whose Source document type is Deal. Earmark deal amended is not re-sent: re-apply the act if the event is still needed, then dismiss the row. A row for a claim, price build-up or vendor event is never re-sent by Retry: dismiss it, and do not retry it (see When it fails).The event id is unchanged, so a subscriber can drop a duplicate.
Timeline writeDealsWrites the missing timeline row from the act recorded in the message, with the original time. A row whose message carries no recorded act is refused: dismiss it with a reason.It writes the one missing row.
Workflow callback writeDealsFor a deal: re-reads the workflow and re-applies its outcome. A deal already in that status counts as done, an ended deal is never revived (a workflow still pending on it is canceled), a faulted workflow is left for a person, and a deal that has been through a later workflow is refused. For a claim: closes a workflow the claim no longer needs; while the claim is Pending approval the row is resolved with nothing done.It sets a status, it does not add one.
Segregation of duties seedDealsSeeds Earmark's segregation of duties rules again. Resolved only when every rule is in place.The seed adds only the rules that are missing.
Terminal hook notifyDealsIf the deal is still closed or aborted, produces the open-accrual report and notifies the owner again; otherwise refuses with "Deal ... is no longer closed or aborted...".It moves no money. The owner can receive the notification twice.
Accrual movementTallyProcesses the accrual event again. An event already processed resolves the row; an event the processor has taken back into its queue is refused, so the processor and the retry never post it twice.Each event posts at most once.
Journal postTallyResolved if the movement has posted. Posts the journal only if it was created for automatic posting; a journal held for review is refused ("...Retry does not post it. Post the journal by hand...").A posted journal is never posted again.
Pulse emitTallyRe-sends the accrual event (accrued, reversed or returned) with its original event id.The event id is unchanged.
Inventory provision attachTallyAttaches the sales line to its inventory deals again. Resolved if the line no longer exists, and resolved without attaching while Inventory deals is off.A deal already attached to the line is skipped.
Inbound price buildBasisApplies the inbound pricing policy to the line again, reading the policy as it is now. Refused with a warning while Inbound auto-pricing is off. Resolved if the line no longer exists.A line that already has a price build is left alone.
Render claim statementClaimsRenders the statement again from the request recorded on the row.It moves no money; a statement is regenerated from data.
Post claim approval journalClaimsPosts the approval journal for the claim's lines again. If it fails again, a second row is raised for the claim and this one stays Open.Lines that already have an approval movement are skipped.
Mirror vendor-side movementVendor shapesPairs the customer movement with its vendor side. Resolved if the pair already exists.A paired movement is not paired twice.
Vendor settlement run itemVendor shapesProcesses the run's group of transactions again, as you.A transaction can be on only one claim line, so one already claimed cannot be claimed again.
Headless purchase attachVendor shapesBuilds the purchase line's price with every eligible vendor deal again. Resolved if the line no longer exists.A line that already has a price build is left alone.
Third-party attach createVendor shapesCreates the sales-triggered vendor accrual for the line again. Resolved if the line no longer exists.A deal already attached to the line is skipped.
Snapshot buildConfigurationRebuilds the configuration register for your current company.A rebuild replaces the snapshot.
Migration stepConfigurationLowers the step's exception count. It does not run the step again; re-run the migration step itself.Nothing is posted.
Checklist evaluationConfigurationRe-evaluates the setup checklist for your current company.An evaluation only reads setup.
License state writeConfigurationChecks the license again and records the answer.It records a status.
Migration Pulse emitConfigurationRe-sends Migration batch certified for the batch.The event id is unchanged.
License Pulse emitConfigurationRe-sends License state changed with the current verdict.It reports the current status.

The Operation list on the workbench also offers Accrual event capture, Balance update, Return reversal and Bulk reversal, but nothing in this release raises a row under them, so you will not find one to retry. Where those failures go instead:

  • A lost accrual capture raises nothing at all. Only the Unaccrued transaction sweep finds and repairs it, so keep it scheduled.
  • A failure while the accrual event processor handles an accrual or a return appears as Accrual movement.
  • A failed Rebuild balances shows as an error in your infolog; run it again (Rebuild balances).
  • A movement that Reverse accruals could not reverse is reported in the infolog of the person who ran it; select that movement and reverse it again.

A row that names no record, or a record that no longer exists, is refused with "The ... exception ... does not name the record it is about..." or "...does not name a record that still exists...". Dismiss it with a reason.

What a row holds​

Exception status, Exception ID, Company, Source area, Operation, Source document type, Source document, Message, Retries, Last attempt, Dismiss reason, and when and by whom it was created. A retry never changes the Message: the outcome of each attempt is in the infolog of the person who retried. The same rows can be read through the read-only data entity /data/MGCEarmarkExecutionExceptions; see the entity reference.

Watching it​

  • Earmark > Inquiries and reports > Earmark execution exceptions: every row, from every company. Filter Exception status to Open and Retrying to see the work.
  • The Execution exceptions tile on the Earmark workspace opens the same list. It counts every row in it, closed ones included, so read the list rather than the number.
  • The Accrual execution exceptions tile on the Deal control workspace counts Open and Retrying rows from the Tally source area (the accrual engine).
  • Retry in the Related information group on Accrual transactions opens the workbench filtered to rows about the selected movement (for example Journal post and Pulse emit). It retries nothing itself.
  • The business event Earmark execution exception created lets a monitoring system alert on new rows without polling. It announces creation only. See Earmark business events.

When it fails​

Fix the cause first. The Message names it: usually a posting profile row, a journal name, a dimension rule, print management for claim statements, or the reason the ledger refused a journal. A held journal whose period closed or whose dimension value was suspended is corrected with Correct held journal, never edited; see Pricing and accruals: work the execution exceptions workbench and Respond to a failed operation.

Then retry, in the row's company. Switch to the company shown in the row's Company column before you select Retry selected. Retry runs the handler in your current company. For a row from another company, a handler that looks up an order line finds nothing and marks the row Resolved without doing the work; a handler that looks up an accrual event or a movement refuses with "...does not name a record that still exists..." and the row stays Open; and a handler that works on the whole company (Snapshot build, Checklist evaluation) acts on your company instead of the row's.

Retry re-sends deal events only. On an Event publish row, Retry looks for a deal. A row for a claim, price build-up or vendor event never resolves through Retry, and retrying it can re-send the event of an unrelated deal and mark the row Resolved. Dismiss those rows with a reason instead. Pulse emit, License Pulse emit and Migration Pulse emit rows are re-sent as the operations table says.

Event rows need their switch on. Any business event re-sent while its switch on the Events tab is off sends nothing, and the row still reads Resolved. That holds for deal and accrual events and for the license and migration events, which follow Publish deal events. If a re-send fails again, the row you retried reads Resolved and a new Open row records the new failure.

Setup you fixed is not noticed by the checklist by itself. After adding a posting profile row, a dimension rule or a flagged reason, select Re-evaluate on the setup checklist; its row stays Open until then. See Setup checklist.

Retry is safe to repeat. Each handler checks what has already happened before acting (see the last column of the operations table), and only one retry of a row runs at a time. No retry can post money twice. What can repeat is a message: a business event can reach a subscriber twice with the same event id, and a deal owner can be notified twice.

Dismiss what nobody will fix. Dismissing fixes nothing; the reason records why no retry will be attempted, and the row stays as evidence until the retention period passes.

Effects on the rest of Earmark​

  • Nothing that started a step is undone. The posted document, the approved deal, the approved claim and the posted movement stand whatever happens to the step.
  • Some states wait for their row. A claim stays Approved with posting pending until its Post claim approval journal row is resolved. An accrual journal stays unposted until its Journal post row is resolved or a person posts it. An order line stays unpriced until its Inbound price build or Headless purchase attach row, when a row was raised, is resolved or a person builds it.
  • Business events. Every new row can send Earmark execution exception created. A failure to send that event is reported in the infolog only, so the workbench never feeds itself.
  • Retention. Resolved and dismissed rows are removed after Execution exception retention (days); see Retention cleanup.
  • Modules switched off. The workbench and its tile stay available, so rows raised before a module was switched off can still be retried or dismissed.