invoke

operator fun invoke(): EitherNel<InstanceError, BusinessObject>

This method enables the creation of instances of this BusinessObjectType. It should be used to create new BusinessObjects of this BusinessObjectType to which no Event has been applied yet.

Return

If the provided property values are valid, returns a new BusinessObject of this BusinessObjectType with the provided property values (propsValues). Attributes without a value will be set to null. The BusinessObject.id is set to -1, and the BusinessObject.state is set to State.Initial.

A NonEmptyList of InstanceErrors if one of the provided property values in invalid.


operator fun invoke(id: Long, state: State, masters: Map<String, BusinessObject>, vararg propsValues: Any?): EitherNel<InstanceError, BusinessObject>
operator fun invoke(id: Long, state: State = State.Initial, props: Map<String, Any?> = emptyMap()): EitherNel<InstanceError, BusinessObject>