When would you use a child case instead of using a case reference ?

A case reference is for sharing data between related cases, but isn’t a child case able to also share data ? So, when would you use a child case?

@OkiO1914

A case reference is used to retrieve data from another case to be used in the processing of the current case. This is a sibling case relationship and the case processes do not need to depend on each other. This is more of a data modelling concept.

A subcase is used when you need a parent->child relationship, where the parent and child case processes have dependencies on each other. This is more of a processing/case design concept.

For example: a case type that manages appointments could have a case relationship setup to reference previously scheduled appointments (which are modelled as cases), so that we can schedule an appointment in a slot that is not already taken. Here there is no process dependency between the two case types, only a data reference.

For a subcase relationship we can have the following: consider a care plan for a medical patient who is preparing for surgery, there could be tasks that the patient needs to complete before the surgery can go ahead, such as booking an appointment slot, making payments, performing health assessments etc.We can model the care plan as a parent case and the tasks as subcases because the parent care plan case and the task subcases processes depend on each other. Using a wait shape we can configure the parent case process to stop and wait until all of the preparation subcases are completed before proceeding to the surgery.