# Stateflow, State and Reason on Datanodes

**URL:** <https://developerforum.realequity.dk/t/stateflow-state-and-reason-on-datanodes/173>\
**Category:** Datanodes\
**Tags:** docs, datanode, stateflow, state, reason\
**Created:** [June 10, 2022, 9:55am UTC](https://developerforum.realequity.dk/t/stateflow-state-and-reason-on-datanodes/173 "2022-06-10T09:55:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asbjoern](https://dub1.discourse-cdn.com/flex013/user_avatar/developerforum.realequity.dk/asbjoern/32/17_2.png) [@asbjoern](https://developerforum.realequity.dk/u/asbjoern)\
**Post date:** [June 10, 2022, 9:55am UTC](https://developerforum.realequity.dk/t/stateflow-state-and-reason-on-datanodes/173/1 "2022-06-10T09:55:37Z")

</div>

> ⚠ **Subject to change!**  
> Case Sale Stateflow an reasons described in this topic, has been depricated in November 2023. Older cases, without recent activity, may however still use the depricated stateflows, which can be identified by the stateflowNamespace property having the value _dk.realequity.stateflow.salecase_.
> 
> Currently valid stateflows are desribed here: [Stateflows, states and endresults on cases](https://developerforum.realequity.dk/t/stateflows-states-and-endresults-on-cases/1400).

> ℹ **C&B Classic and States**  
> RealEquity have many new possibilities and not all can be used by C&B Classic. Only a subset of the Stateflow framwork is in motion when using C&B Classic and RealEquity together. The standard Stateflows will be updated over time to better reflect the new possibilities in RealEquity.

# Stateflows

Each Datanode have a Stateflow specified that defines the different states and reasons that can be used for the specific Datanode.

Each Datanode Instance Type have configured a default Stateflow for that Instance Type. When a Datanode instance have been created, the default Stateflow can be overridden by calling the [SetStateFlow](https://docs.realequity.dk/reference/setstateflow).

Custom Stateflows can be added through COCO JSON Import. This will require planning and thoroughly knowledge about the consequences of implementing custom flows for a Datanode.

There are some default Stateflows in the system.

## Standard Stateflows

### Default State Flow

_Namespace: dk.realequity.stateflow.default_  
This Stateflow is the default for any Datanode. If no other Stateflow is specified, the Datanode will be using this Stateflow.

| State | Namespace | Reasons |
| --- | --- | --- |
| Draft | dk.realequity.state.draft | Initial Reason  
Moved out of draft state  
Abandoned |
| Active | dk.realequity.state.active | Moved out of active state  
Moved back to draft state |
| Completed | dk.realequity.state.complete | Moved back to active state |

### Appointment Default State Flow

_Namespace: dk.realequity.stateflow.appointment.default_  
This Stateflow is used to define the flow for an Appointment Datanode.

| State | Namespace | Reasons (exit) | State Category |
| --- | --- | --- | --- |
| Ikke bekræftet | dk.realequity.state.notconfirmed | Bekræftet  
_Reason namespace: dk.realequity.stateflow.reason.appointment.confirmed  
Target state:  
dk.realequity.state.confirmed_  
  
Aflyst  
_Reason namespace: dk.realequity.stateflow.reason.appointment.canceled  
Target state:  
dk.realequity.state.canceled_ | dk.realequity.statecategory.preprocessing |
| Bekræftet | dk.realequity.state.confirmed | Ikke bekræftet  
_Reason namespace: dk.realequity.stateflow.reason.appointment.notconfirmed  
Target state:  
dk.realequity.state.notconfirmed_  
  
Aflyst  
\*Reason namespace: dk.realequity.stateflow.reason.appointment.canceled  
Target state:  
dk.realequity.state.canceled | dk.realequity.statecategory.inprogress |
| Aflyst | dk.realequity.state.canceled | Bekræftet  
\_Reason namespace: dk.realequity.stateflow.reason.appointment.confirmed  
Target state: dk.realequity.state.confirmed  
  
Ikke bekræftet  
\_Reason namespace: dk.realequity.stateflow.reason.appointment.notconfirmed  
Target state:  
dk.realequity.state.notconfirmed\* | dk.realequity.statecategory.removed |

### Case Sale State Flow

_Namespace: dk.realequity.stateflow.salecase_

> ℹ This stateflow is depricated. It may however, still be in use on older cases without recent activity. (Any Classic activity on a case will update the stateflow).

> **Click here to expand description**
>
> This Stateflow is used to define the flow for a Case Datanode.
> 
> > ℹ Reasons and the States in the State Flow  
> > The Reasons defined in the list below is possible Reasons to move FROM the current State to a NEW State.
> 
> | State | Namespace | Reasons (exit) | State Category |
> | --- | --- | --- | --- |
> | Kladde | dk.realequity.state.draft | Forhandling igang  
> _Reason namespace:  
> dk.realequity.stateflow.case.reason.negotiation  
> Target state: dk.realequity.state.negotiation_  
> Aftale indgået  
> _Reason namespace: dk.realequity.stateflow.case.reason.agreement-signed  
> Target state: dk.realequity.state.accepted_  
> Aktiv i markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.active-in-market  
> Target state: dk.realequity.state.active_  
> Afsluttet uden aftale  
> _Reason Namespace: dk.realequity.stateflow.case.reason.no-agreement  
> Target state: dk.realequity.state.completed_  
> Erstattet af anden ydelse  
> _Reason Namespace: dk.realequity.stateflow.case.reason.replaced-by-other-offer  
> Target state: dk.realequity.state.completed_ | dk.realequity.statecategory.preprocessing |
> | Forhandling | dk.realequity.state.negotiation | Flyttet til kladde  
> _Reason namespace: dk.realequity.stateflow.case.reason.moved-to-draft  
> Target state: dk.realequity.state.draft_  
> Aftale indgået  
> _Reason namespace: dk.realequity.stateflow.case.reason.agreement-signed  
> Target state: dk.realequity.state.accepted_  
> Aktiv i markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.active-in-market  
> Target state: dk.realequity.state.active_ | dk.realequity.statecategory.preprocessing |
> | Accepteret | dk.realequity.state.accepted | Yderligere forhandlinger nødvendigt  
> _Reason namespace: dk.realequity.stateflow.case.reason.more-negotiation-needed  
> Target state: dk.realequity.state.negotiation_  
> Aktiv i markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.active-in-market  
> Target state: dk.realequity.state.active_  
> Erstattet af anden ydelse  
> _Reason namespace: dk.realequity.stateflow.case.reason.replaced-by-other-offer  
> Target state: dk.realequity.state.completed_  
> Afsluttet uden handel  
> _Reason namespace: dk.realequity.stateflow.case.reason.no-deal  
> Target state: dk.realequity.state.completed_  
> Afsluttet med handel  
> _Reason namespace: dk.realequity.stateflow.case.reason.yes-deal  
> Target state: dk.realequity.state.completed_ | dk.realequity.statecategory.preprocessing |
> | Aktiv | dk.realequity.state.active | Fjernet fra markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.removed-from-market  
> Target state: dk.realequity.state.accepted_  
> Yderligere forhandlinger nødvendigt  
> _Reason namespace: dk.realequity.stateflow.case.reason.more-negotiation-needed  
> Target state: dk.realequity.state.negotiation_  
> Afsluttet uden handel  
> _Reason namespace: dk.realequity.stateflow.case.reason.completed-no-deal  
> Target state: dk.realequity.state.completed_  
> Afsluttet med handel  
> _Reason namespace: dk.realequity.stateflow.case.reason.completed-yes-deal  
> Target state: dk.realequity.state.completed_  
> Handel indgået  
> _Reason namespace: dk.realequity.stateflow.case.reason.yes-deal  
> Target state: dk.realequity.state.completed_ | dk.realequity.statecategory.inprogress |
> | Efterbehandling | dk.realequity.state.postprocessing | Handel endeligt afsluttet  
> _Reason namespace: dk.realequity.stateflow.case.reason.completed-yes-deal  
> Target state: dk.realequity.state.completed_  
> Genaktiveret i markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.reactivated-in-market  
> Target state: dk.realequity.state.active_ | dk.realequity.statecategory.postprocessing |
> | Afsluttet | dk.realequity.state.completed | Genaktiveret i markedet  
> _Reason namespace: dk.realequity.stateflow.case.reason.reactivated-in-market  
> Target state: dk.realequity.state.active_ | dk.realequity.statecategory.completed |
> | Fjernet | dk.realequity.state.removed | | dk.realequity.statecategory.removed |
> 
> To get detailed information about Stateflows, States, Reasons and State Categories, download the Core Configuration from the Admin portal.
> 
> ## Mapping from Classic States
> 
> | Classic sagstatus | statenamespace | statereason (entry) | statecategory |
> | --- | --- | --- | --- |
> | V = Blank | dk.realequity.state.draft | dk.realequity.stateflow.case.reason.new | preprocessing |
> | G = Salgsvurdering | dk.realequity.state.negotiation | dk.realequity.stateflow.case.reason.negotiation | preprocessing |
> | U = Formidlingsaftale indgået | dk.realequity.state.accepted | dk.realequity.stateflow.case.reason.agreement-signed | preprocessing |
> | A = Salgsaktiv | dk.realequity.state.active | dk.realequity.stateflow.case.reason.active-in-market | inprogress |
> | N = Købsaftale underskrevet | dk.realequity.state.postprocessing | dk.realequity.stateflow.case.reason.yes-deal | postprocessing |
> | S = Handlen er endelig | dk.realequity.state.completed | dk.realequity.stateflow.case.reason.completed-yes-deal | completed |
> | O = Lukket uden formidlingsaftale | dk.realequity.state.completed | dk.realequity.stateflow.case.reason.no-agreement | completed |
> | H = Lukket uden handel | dk.realequity.state.completed | dk.realequity.stateflow.case.reason.completed-no-deal | completed |
> | C = Berigtigelse annulleret | dk.realequity.state.postprocessing | dk.realequity.stateflow.case.reason.rectification-canceled | postprocessing |
> | B = Berigtigelse igangsat | dk.realequity.state.rectification | dk.realequity.stateflow.case.reason.rectification-started | postprocessing |
> | D = Berigtigelse gennemført | dk.realequity.state.completed | dk.realequity.stateflow.case.reason.completed-yes-deal | completed |
> | Z = Sat i bero | dk.realequity.state.accepted | dk.realequity.stateflow.case.reason.removed-from-market | preprocessing |
> 
> # States and Reasons
> 
> Stateflows contain definitions for a number of States and how it is possible to move between each of the States. To move from one state to another, at least one Reason needs to exist, that makes the move possible. A Reason is defined on a State and points to a different State.  
> A State and Reason can be set on a Datanode by calling the [UpdateState](https://docs.realequity.dk/reference/updatedatanodestate)
> 
> > ⚠ **A State is always a part of ONE State Category**  
> > All States defines what State Category they are a part of. It is not possible for a State to be in more than one State Category or be without a State Category.

## State Categories

State Categories are system wide known by the RealEquity platform. Unlike States, State Categories cannot be changed or extended. A State Category defines the generalized place in any Stateflow. An example: If a Case is in the StateCategory: InProgress, the Case must be active in the market.

| State Category | Namespace | Description |
| --- | --- | --- |
| PreProcessing | dk.realequity.statecategory.preprocessing | The Datanode is in a state before the “active” period. A Datanode in this category could be (as an example) in a Draft State or in Negotiation State. |
| InProgress | dk.realequity.statecategory.inprogress | The Datanode is in the “active” period of its life. A Datanode in this category could be (as an example) in an Active State. If this was the case for a Case Datanode Instance Type, the Case would be available in the market. |
| InitPostProcessing | dk.realequity.statecategory.initpostprocessing | The Datanode in this category would be in an evaluation state before going into the PostProcessing State Category. As an example: A Case Datanode with this category would be waiting for a number of requirements or deadlines to be expired, so the Case can move on to the PostProcessing State Category. |
| PostProcessing | dk.realequity.statecategory.postprocessing | Datanodes in this category have come to the point where the Datanode is getting finished up to move on to the Completed State category. As an example: A Case datanode would be in this category when a buyer is found and the work to finalize the deal is going on. |
| Completed | dk.realequity.statecategory.completed | Datanodes in this category would have come to the end of its life. As an example, a Case Datanode would be in this state, if the deal was finalized or if the case was lost. |
| Failed | dk.realequity.statecategory.failed | The Datanode is in some form of failed State. This will only happen if the system ends up resolving the state category to a unknown type. |
| Removed | dk.realequity.statecategory.removed | The Datanode is no longer relevant, and have been removed from normal list views. Datanodes in the Removed category will not be shown when doing standard searches or lists for the Datanode. |

---

<div class="post-metadata">

**Author:** ![asbjoern](https://dub1.discourse-cdn.com/flex013/user_avatar/developerforum.realequity.dk/asbjoern/32/17_2.png) [@asbjoern](https://developerforum.realequity.dk/u/asbjoern)\
**Post date:** [June 10, 2022, 10:27am UTC](https://developerforum.realequity.dk/t/stateflow-state-and-reason-on-datanodes/173/2 "2022-06-10T10:27:02Z")

</div>

Closed on June 10, 2022, 10:27am UTC


