: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.
:page-partial:


=== Execution Publishing

The xref:refguide:applib:index/annotation/Action.adoc#executionPublishing[executionPublishing()] element determines whether and how an action invocation is published via the registered implementation of xref:refguide:applib:index/services/publishing/spi/ExecutionSubscriber.adoc[ExecutionSubscriber].

A common use case is to notify external "downstream" systems of changes in the state of the Apache Causeway application.

The xref:refguide:config:sections/causeway.applib.adoc#causeway.applib.annotation.property.execution-publishing[causeway.applib.annotation.property.execution-publishing] configuration property is used to determine the whether the action invocation is published:

* `all`
+
all action invocations are published

* `ignoreSafe` (or `ignoreQueryOnly`)
+
invocations of actions with safe (read-only) semantics are ignored, but actions which may modify data are not ignored

* `none`
+
no action invocations are published

If there is no configuration property in `application.properties` then publishing is automatically enabled.

This default can be overridden on an action-by-action basis; if `executionPublishing()` is set to `ENABLED` then the action invocation is published irrespective of the configured value; if set to `DISABLED` then the action invocation is _not_ published, again irrespective of the configured value.

For example:

[source,java]
----
public class Order {
    @Action(executionPublishing=Publishing.ENABLED)    // <.>
    public Invoice generateInvoice(...) {
        // ...
    }
}
----

<.> because set to enabled, will be published irrespective of the configured value.


