= Execution
: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.

Represents an action invocation/property edit as a node in a call-stack execution graph, with sub-interactions being made by way of the xref:refguide:applib:index/services/wrapper/WrapperFactory.adoc[WrapperFactory] ).

The xref:refguide:applib:index/services/iactn/Interaction.adoc[Interaction] has a reference to a _Interaction#getCurrentExecution() top-level_ execution.

== API

[source,java]
.Execution.java
----
class Execution<T, E> {
  void setParent(Execution<?, ?> parent)     // <.>
  List<Execution<?, ?>> getChildren()     // <.>
  void setEvent(E event)     // <.>
  Timestamp start(ClockService clockService, MetricsService metricsService)
  void setCompletedAt(Timestamp completedAt, MetricsService metricsService)     // <.>
  void setReturned(Object returned)     // <.>
  void setThrew(Exception threw)     // <.>
  void setDto(T executionDto)     // <.>
}
----

<.> xref:#setParent_Execution[setParent(Execution)]
+
--
 *NOT API* : intended to be called only by the framework.
--
<.> xref:#getChildren_[getChildren()]
+
--
The actions/property edits made in turn via the xref:refguide:applib:index/services/wrapper/WrapperFactory.adoc[WrapperFactory] .
--
<.> xref:#setEvent_E[setEvent(E)]
+
--
 *NOT API* : intended to be called only by the framework.
--
<.> xref:#setCompletedAt_Timestamp_MetricsService[setCompletedAt(Timestamp, MetricsService)]
+
--
 *NOT API* : intended to be called only by the framework.
--
<.> xref:#setReturned_Object[setReturned(Object)]
+
--
 *NOT API* : intended to be called only by the framework.
--
<.> xref:#setThrew_Exception[setThrew(Exception)]
+
--
 *NOT API* : intended to be called only by the framework.
--
<.> xref:#setDto_T[setDto(T)]
+
--
 *NOT API* : Set by framework (implementation of _org.apache.isis.core.metamodel.execution.InternalInteraction.MemberExecutor_ )
--

== Members

[#setParent_Execution]
=== setParent(Execution)

 *NOT API* : intended to be called only by the framework.

[#getChildren_]
=== getChildren()

The actions/property edits made in turn via the xref:refguide:applib:index/services/wrapper/WrapperFactory.adoc[WrapperFactory] .

[#setEvent_E]
=== setEvent(E)

 *NOT API* : intended to be called only by the framework.

[#setCompletedAt_Timestamp_MetricsService]
=== setCompletedAt(Timestamp, MetricsService)

 *NOT API* : intended to be called only by the framework.

[#setReturned_Object]
=== setReturned(Object)

 *NOT API* : intended to be called only by the framework.

[#setThrew_Exception]
=== setThrew(Exception)

 *NOT API* : intended to be called only by the framework.

[#setDto_T]
=== setDto(T)

 *NOT API* : Set by framework (implementation of _org.apache.isis.core.metamodel.execution.InternalInteraction.MemberExecutor_ )

include::hooks/Execution_010-implementation.adoc[]

include::hooks/Execution_020-examples-and-usage.adoc[]
