= InteractionDtoFactory
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Used to serialize the execution of an action invocation or property edit as an _org.apache.isis.schema.ixn.v2.InteractionDto_ , for example that it can be published to downstream systems.

There are some similarities to _org.apache.isis.core.metamodel.services.command.CommandDtoFactory_ , which is used to instantiate an _org.apache.isis.schema.cmd.v2.CommandDto_ that represents the _intention_ to invoke an action or edit a property.

== API

[source,java]
.InteractionDtoFactory.java
----
interface InteractionDtoFactory {
  ActionInvocationDto asActionInvocationDto(ObjectAction objectAction, InteractionHead head, Can<ManagedObject> argumentAdapters)     // <.>
  PropertyEditDto asPropertyEditDto(OneToOneAssociation property, ManagedObject targetAdapter, ManagedObject newValueAdapterIfAny, InteractionHead interactionHead)     // <.>
  ActionInvocationDto updateResult(ActionInvocationDto actionInvocationDto, ObjectAction objectAction, ManagedObject resultObject)     // <.>
}
----

<.> xref:#asActionInvocationDto_ObjectAction_InteractionHead_Can[asActionInvocationDto(ObjectAction, InteractionHead, Can)]
+
--
Called by the framework when invoking an action, to create an _ActionInvocationDto_ capturing the details of the action invocation (target, arguments etc).
--
<.> xref:#asPropertyEditDto_OneToOneAssociation_ManagedObject_ManagedObject_InteractionHead[asPropertyEditDto(OneToOneAssociation, ManagedObject, ManagedObject, InteractionHead)]
+
--
Called by the framework when editing a property, to create an _PropertyEditDto_ capturing the details of the action invocation (target, arguments etc).
--
<.> xref:#updateResult_ActionInvocationDto_ObjectAction_ManagedObject[updateResult(ActionInvocationDto, ObjectAction, ManagedObject)]
+
--
Called by the framework to attach the result of an action invocation to the aforementioned _ActionInvocationDto_ .
--

== Members

[#asActionInvocationDto_ObjectAction_InteractionHead_Can]
=== asActionInvocationDto(ObjectAction, InteractionHead, Can)

Called by the framework when invoking an action, to create an _ActionInvocationDto_ capturing the details of the action invocation (target, arguments etc).

_ActionInvocationDto_ is a subtype of _org.apache.isis.schema.ixn.v2.MemberExecutionDto_ that is in turn a part of the overall _org.apache.isis.schema.ixn.v2.InteractionDto_ .

[#asPropertyEditDto_OneToOneAssociation_ManagedObject_ManagedObject_InteractionHead]
=== asPropertyEditDto(OneToOneAssociation, ManagedObject, ManagedObject, InteractionHead)

Called by the framework when editing a property, to create an _PropertyEditDto_ capturing the details of the action invocation (target, arguments etc).

_PropertyEditDto_ is a subtype of _org.apache.isis.schema.ixn.v2.MemberExecutionDto_ that is in turn a part of the overall _org.apache.isis.schema.ixn.v2.InteractionDto_ .

[#updateResult_ActionInvocationDto_ObjectAction_ManagedObject]
=== updateResult(ActionInvocationDto, ObjectAction, ManagedObject)

Called by the framework to attach the result of an action invocation to the aforementioned _ActionInvocationDto_ .
