Skip to content

feat: callerRef support for multi-instance template instantiation #166

@mdproctor

Description

@mdproctor

Summary

When the casehub-engine HumanTaskTarget binding references a multi-instance WorkItem template, each spawned child needs its own callerRef so WorkItemLifecycleEvent completions route back to the correct PlanItem in the case engine.

Currently WorkItemTemplateService.instantiate() with a multi-instance template delegates to MultiInstanceSpawnService.createGroup(), which has no callerRef parameter. The callerRef is silently ignored with a warning (see #165).

What needs to happen

  • MultiInstanceSpawnService.createGroup() needs a callerRef parameter (or an overload)
  • Each child WorkItem in the group should carry callerRef so its completion event routes correctly
  • The engine's HumanTaskScheduleHandler needs to decide how to handle M-of-N completion routing — when M children complete, which PlanItem transitions? Likely the parent binding's planItemId, using MultiInstanceCoordinator to fire the parent transition

Dependencies

Complexity

Non-trivial. Requires coordination between casehub-work multi-instance completion semantics and casehub-engine PlanItem transitions. Design session needed before implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions