Case creation logic
To work efficiently with Casewhere, developers and configurators must understand the case creation logic and its constraints on workflows and data.
Workflow constraints
When creating a new workflow, you must decide whether it will create a new case or modify an existing one.
When triggering a create-case workflow, Casewhere creates a new case object with the state Draft
. All data objects generated during case creation will also have their CaseState
set to Draft
. Access to a draft case and its associated data is restricted as follows:
- Draft cases are visible only in data widgets and queries that explicitly include them in their filtering logic.
- Cases cannot be edited until they are fully created. For example, end users cannot trigger edit-case workflows while the case is in the
Draft
state. Therefore, they must first complete the create-case workflow before executing any further workflows on the case. To do so, end users must finish all required activities defined in the workflow. Once the create-case workflow is completed, Casewhere updates the case state toCreated
.
Configuration constraints
Whenever you set up a trigger for a "create-case" workflow—such as from a widget action on a webpage or an API call via a web trigger—you must specify the process in which the workflow will run.
Please note that Casewhere will only display processes related to the selected workflow definition. In other words, the workflow must work with the data classes supported by the process.
Data constraints
Casewhere only allows adding new data objects to a case if the case process supports the corresponding data classes. Additionally, Casewhere controls whether a process accepts a single or multiple data objects for a specific case. For example, the "Applying for job" process should only allow one "Application" data object.
When a data object is created in a draft case, the CaseState
of the data object is also set to Draft
. Access to draft data objects will be restricted similar to the draft cases. When the create-case workflow is completed, Casewhere will set the state of the case and all associated data objects to Created
.
If the workflow enables draft saving, Casewhere will always create the case and its data objects as Created
.