Issue Management Guide
NPM SDK guide for creating issue markers, linking host-owned task records, synchronizing selection, and recovering from incomplete marker workflows.
Issue title, assignee, priority, due date, notes, and resolved status belong to the host application or its backend. The NPM SDK supplies the drawing and annotation lifecycle used to link each issue to a Canvas marker. Mount the viewer, wait for viewer.ready(), and open the drawing before enabling Add issue.
Create a marker before saving the issue record. The marker guid is the stable link that joins the host task to its Canvas location.
- 1Open the drawing and register created, selected, and deleted listeners.
- 2Enable the issue-marker drawing action.
- 3Keep a pending-issue state while the operator places one marker.
- 4Capture the created event guid and open the task editor.
- 5Save the host task with the guid as its annotation link.
- 6Clear the active drawing tool after save, cancel, or navigation away from the workflow.
Use a documented shape action for the marker. The tool result tells the host whether Canvas enabled drawing; the created event provides the marker identifier. Do not save a task when the event has no usable guid.
viewer.tools.set({ action: "SHAPE_ELLIPSE", enabled: true, style })viewer.annotations.on("created", handleCreated)viewer.annotations.on("createdWithDetail", handleCreatedDetail)viewer.tools.set({ action: "SHAPE_ELLIPSE", enabled: false })viewer.tools.clear()
Persist the task independently from Canvas and retain annotationGuid as its location link. Resolving or reopening a task changes host task state; it does not imply a Canvas command unless the product separately defines one.
- Require a title and captured
annotationGuidbefore the first task save. - Keep pending marker state separate from a selected saved issue.
- Store assignee, priority, due date, status, and notes in the task record.
- Use
annotationGuidfor later selection, deletion, and any optional marker styling. - Validate task fields according to the host data model before backend persistence.
Use the selected event to update the task panel when an operator picks a marker in Canvas. When the operator selects a task in the host list, request Canvas selection using its stored guid. Selection is fire-and-forget, so do not present the list request as confirmed until the selected event arrives.
viewer.annotations.on("selected", handleSelected)viewer.annotations.select({ guid: annotationGuid })viewer.annotations.unselect()
Deletion is fire-and-forget. Keep a saved task until Canvas emits deleted for its annotation guid, then remove it or mark it as unlocated according to the product policy.
viewer.annotations.delete({ guid: annotationGuid })viewer.annotations.on("deleted", handleDeleted)- If marker-tool activation fails, do not enter pending-issue state; retain draft task inputs and offer retry.
- If a created event has no guid, close pending marker state without creating a task.
- On cancel of an unsaved task, clear the tool and request deletion of the captured marker only when the product policy calls for removing it.
- Unsubscribe annotation listeners and destroy the viewer during route cleanup.
Test creation, list-to-canvas selection, canvas-to-list selection, cancellation, task status changes, and marker deletion.
- Add issue is disabled until the drawing is ready.
- The task editor opens only after a created event supplies a guid.
- A saved task retains the same annotation guid as its marker.
- Selecting a marker opens the matching host task.
- Selecting a host task is confirmed through the Canvas selected event.
- Resolve and reopen update only the host task state unless a separately documented Canvas behavior is added.
- Deleting a marker does not silently leave an orphaned task record.
- Route cleanup removes listeners and stale pending state.
