The case type settings allow the case to be created as temporary and saved later if 'Persist' shape is reached.
However, there is no setting that can conditionally create the temporary case only if this case type is not initiated as child case.
Consider a case 'B' can be created as top-level case or as a child case of another case, say 'A'.
If case B is set as 'Temporary case', then this configuration will work great as long as this case is created as top level case. When a parent case A created the child case B, then the child case B will not show up in anyone's worklist/workqueue because it is defined as a temporary case and not persisted.
Expected: In the App Studio, In the case type Settings -> General -> Behavior, the checkbox "Create temporary case that is not saved until a 'Persist case' step is reached", when checked, should have an additional option like "Create temporary case only if not a child case".
Workaround: For a case type that is defined as a temporary case, what is the woraround to create this case as a non-temporary case if created as a child case?
In the data transform pyDefault , I tried to change the OTB value (behind the checkbox "Create temporary case that is not saved until a 'Persist case' step is reached") depending on if this case type is a child case or a top level case. The problem is, the pyDefault runs even before the data is propagated from the parent case, so there is no easy way to check.
Circumstancing the case type rule pyStartCase did not work either because the cirumstanced property was based on data propagated value from parent, and this case type rule runs even before any data is propagated, so the behavior is the same regardless of a child case of a top level case.
Based on your suggestion, in the first stage, we can add a step that will persist the case if a child case. By the time the first stage runs, the child case is fully instantiated and hence should know if a parent case exists or not. It would be nice if there's a much cleaner workaround, to avoid modifying stage steps for conditional temporary case creation.