You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/02/01 09:33:28 UTC

git commit: ISIS-672: making ReifiableActionJdo same shape as BackgroundTaskJdo

Updated Branches:
  refs/heads/master 2463dc18c -> af78da45f


ISIS-672: making ReifiableActionJdo same shape as BackgroundTaskJdo

as a prereq to merging the two.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/af78da45
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/af78da45
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/af78da45

Branch: refs/heads/master
Commit: af78da45ffa45fcd26079aeda40005adab7d8a5c
Parents: 2463dc1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Feb 1 08:33:07 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Feb 1 08:33:07 2014 +0000

----------------------------------------------------------------------
 .../jdo/applib/service/JdoColumnLength.java     |   6 +-
 .../jdo/applib/service/audit/AuditEntryJdo.java |  62 ++---
 .../service/background/BackgroundTaskJdo.java   |  98 ++++++++
 .../background/BackgroundTaskServiceJdo.java    |  38 ++-
 .../service/publish/PublishedEventJdo.java      |  89 +++----
 .../reifiableaction/ReifiableActionJdo.java     | 252 +++++++++++--------
 .../reifiableaction/ReifiableActionJdoPK.java   | 102 ++++++++
 .../ReifiableActionServiceJdo.java              |   8 +-
 .../background/ActionInvocationMemento.java     |  16 +-
 .../services/background/BackgroundService.java  |   9 +
 .../background/BackgroundTaskService.java       |   7 +-
 .../reifiableaction/ReifiableAction.java        |  57 ++++-
 .../reifiableaction/ReifiableActionDefault.java |  42 +++-
 .../dflt/ObjectSpecificationDefault.java        |   2 +-
 .../invoke/ActionInvocationFacetViaMethod.java  |  77 +++---
 .../actions/invoke/ReifiableActionUtil.java     | 121 +++++++++
 .../background/BackgroundServiceDefault.java    |  80 ++++--
 .../BackgroundServiceDefaultTest_execute.java   | 187 --------------
 18 files changed, 799 insertions(+), 454 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
index 598a431..bd7de06 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
@@ -39,14 +39,14 @@ public final class JdoColumnLength {
         public static final int VALUE_RAW = 255;
     }
 
-    public static final class Interaction {
-        private Interaction() {
+    public static final class ReifiableAction {
+        private ReifiableAction() {
         }
         public final static int TARGET_CLASS = 50;
         public final static int TARGET_ACTION = 50;
         public final static int ARGUMENTS = 1024;
-        public final static int NOTES = 1024;
         public final static int EXCEPTION = 2000;
+        public static final int NATURE = 20;
     }
 
     public static final class BackgroundTask {

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
index f816997..7cf2c93 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
@@ -83,32 +83,6 @@ public class AuditEntryJdo implements HasTransactionId {
         return buf.toString();
     }
     
-    // //////////////////////////////////////
-    
-    private UUID transactionId;
-
-    /**
-     * The unique identifier (a GUID) of the transaction in which this audit entry was persisted.
-     * 
-     * <p>
-     * The combination of ({@link #getTransactionId() transactionId}, {@link #getTargetStr() target}, {@link #getPropertyId() propertyId} ) makes up the
-     * (non-enforced) alternative key.
-     */
-    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
-    @TypicalLength(36)
-    @MemberOrder(name="Identifiers",sequence = "10")
-    @Hidden(where=Where.PARENTED_TABLES)
-    @Disabled
-    @Override
-    public UUID getTransactionId() {
-        return transactionId;
-    }
-
-    @Override
-    public void setTransactionId(final UUID transactionId) {
-        this.transactionId = transactionId;
-    }
-
 
     // //////////////////////////////////////
     // user (property)
@@ -118,7 +92,7 @@ public class AuditEntryJdo implements HasTransactionId {
 
     @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
     @Hidden(where=Where.PARENTED_TABLES)
-    @MemberOrder(name="Identifiers",sequence = "20")
+    @MemberOrder(name="Identifiers",sequence = "10")
     public String getUser() {
         return user;
     }
@@ -136,7 +110,7 @@ public class AuditEntryJdo implements HasTransactionId {
 
     @javax.jdo.annotations.Column(allowsNull="false")
     @Hidden(where=Where.PARENTED_TABLES)
-    @MemberOrder(name="Identifiers",sequence = "30")
+    @MemberOrder(name="Identifiers",sequence = "20")
     public Timestamp getTimestamp() {
         return timestamp;
     }
@@ -149,6 +123,35 @@ public class AuditEntryJdo implements HasTransactionId {
 
 
     // //////////////////////////////////////
+    // transactionId (property)
+    // //////////////////////////////////////
+    
+    private UUID transactionId;
+
+    /**
+     * The unique identifier (a GUID) of the transaction in which this audit entry was persisted.
+     * 
+     * <p>
+     * The combination of ({@link #getTransactionId() transactionId}, {@link #getTargetStr() target}, {@link #getPropertyId() propertyId} ) makes up the
+     * (non-enforced) alternative key.
+     */
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
+    @TypicalLength(36)
+    @MemberOrder(name="Identifiers",sequence = "30")
+    @Hidden(where=Where.PARENTED_TABLES)
+    @Disabled
+    @Override
+    public UUID getTransactionId() {
+        return transactionId;
+    }
+
+    @Override
+    public void setTransactionId(final UUID transactionId) {
+        this.transactionId = transactionId;
+    }
+
+
+    // //////////////////////////////////////
     // target (property)
     // openTargetObject (action)
     // //////////////////////////////////////
@@ -168,8 +171,7 @@ public class AuditEntryJdo implements HasTransactionId {
     private String targetStr;
 
     @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
-    @Named("Target")
-    //@Hidden(where=Where.OBJECT_FORMS)
+    @Named("Object")
     @MemberOrder(name="Target", sequence="3")
     public String getTargetStr() {
         return targetStr;

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
index ffaa45d..5224506 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
@@ -30,7 +30,9 @@ import org.slf4j.LoggerFactory;
 import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.ActionSemantics.Of;
+import org.apache.isis.applib.annotation.Disabled;
 import org.apache.isis.applib.annotation.Hidden;
+import org.apache.isis.applib.annotation.HomePage;
 import org.apache.isis.applib.annotation.Immutable;
 import org.apache.isis.applib.annotation.MemberGroupLayout;
 import org.apache.isis.applib.annotation.MemberOrder;
@@ -44,6 +46,9 @@ import org.apache.isis.applib.annotation.Where;
 import org.apache.isis.applib.services.HasTransactionId;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction.Nature;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
 import org.apache.isis.applib.util.ObjectContracts;
 import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
 import org.apache.isis.objectstore.jdo.applib.service.Util;
@@ -174,6 +179,76 @@ public class BackgroundTaskJdo implements HasTransactionId {
 
 
 
+    // //////////////////////////////////////
+    // nature (property)
+    // //////////////////////////////////////
+
+    private Nature nature;
+
+    /**
+     * Whether the action was invoked explicitly by the user, or scheduled as a background
+     * task, or as for some other reason, eg a side-effect of rendering an object due to 
+     * get-after-post).
+     */
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.NATURE)
+    @TypicalLength(30)
+    @MemberOrder(name="Identifiers", sequence = "10")
+    public Nature getNature() {
+        return nature;
+    }
+    
+    /**
+     * <b>NOT API</b>: intended to be called only by the framework.
+     * 
+     * <p>
+     * Implementation notes: populated by the viewer as hint to {@link ReifiableActionService} implementation.
+     */
+    public void setNature(Nature nature) {
+        this.nature = nature;
+    }
+    
+
+
+    // //////////////////////////////////////
+    // targetClass (property)
+    // //////////////////////////////////////
+
+    private String targetClass;
+
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.TARGET_CLASS)
+    @TypicalLength(30)
+    @MemberOrder(name="Target", sequence = "10")
+    @Named("Class")
+    public String getTargetClass() {
+        return targetClass;
+    }
+
+    public void setTargetClass(final String targetClass) {
+        this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.ReifiableAction.TARGET_CLASS);
+    }
+
+
+    // //////////////////////////////////////
+    // targetAction (property)
+    // //////////////////////////////////////
+    
+    private String targetAction;
+    
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.TARGET_ACTION)
+    @TypicalLength(30)
+    @MemberOrder(name="Target", sequence = "20")
+    @Named("Action")
+    public String getTargetAction() {
+        return targetAction;
+    }
+    
+    public void setTargetAction(final String targetAction) {
+        this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.ReifiableAction.TARGET_ACTION);
+    }
+    
+
+    
+
 
     // //////////////////////////////////////
     // target (property)
@@ -243,6 +318,28 @@ public class BackgroundTaskJdo implements HasTransactionId {
     }
 
 
+    
+    // //////////////////////////////////////
+    // arguments (property)
+    // //////////////////////////////////////
+    
+    private String arguments;
+    
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.ARGUMENTS)
+    @MultiLine(numberOfLines=6)
+    @Hidden(where=Where.ALL_TABLES)
+    @MemberOrder(name="Detail",sequence = "4")
+    @Disabled
+    public String getArguments() {
+        return arguments;
+    }
+    
+    public void setArguments(final String arguments) {
+        this.arguments = Util.abbreviated(arguments, JdoColumnLength.ReifiableAction.ARGUMENTS);
+    }
+
+
+
     // //////////////////////////////////////
     // memento (property)
     // //////////////////////////////////////
@@ -335,6 +432,7 @@ public class BackgroundTaskJdo implements HasTransactionId {
         return getCompletedAt() != null;
     }
 
+    
     // //////////////////////////////////////
     // toString
     // //////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
index 7954fa1..d0054e5 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.isis.objectstore.jdo.applib.service.background;
 
+import java.lang.reflect.Method;
 import java.util.UUID;
 
 import org.slf4j.Logger;
@@ -28,33 +29,56 @@ import org.apache.isis.applib.clock.Clock;
 import org.apache.isis.applib.services.background.ActionInvocationMemento;
 import org.apache.isis.applib.services.background.BackgroundTaskService;
 import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction.Nature;
 
 @Named("Background Tasks")
 public class BackgroundTaskServiceJdo extends AbstractService implements BackgroundTaskService {
 
     @SuppressWarnings("unused")
     private static final Logger LOG = LoggerFactory.getLogger(BackgroundTaskServiceJdo.class);
+    
+    private final String sequenceName;
 
+    public BackgroundTaskServiceJdo(){
+        sequenceName = this.getClass().getName()+"-sequence";
+    }
+    
     @Programmatic
     @Override
-    public void execute(final ActionInvocationMemento aim, final ReifiableAction reifiableAction) {
+    public void schedule(
+            final ActionInvocationMemento aim, 
+            final ReifiableAction reifiableAction, 
+            final String targetClassName, 
+            final String targetActionName, 
+            final String targetArgs) {
         
         final UUID transactionId = reifiableAction.getTransactionId();
-        Integer sequence = reifiableAction.next("backgroundTaskServiceSequence");
+        final Integer sequence = reifiableAction.next(sequenceName);
+        final String user = reifiableAction.getUser();
 
         final BackgroundTaskJdo backgroundTask = newTransientInstance(BackgroundTaskJdo.class);
 
-        backgroundTask.setActionIdentifier(aim.getActionId());
-        backgroundTask.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
-        backgroundTask.setMemento(aim.asMementoString());
-        backgroundTask.setUser(aim.getUser());
-        backgroundTask.setTargetStr(aim.getTarget().toString());
         backgroundTask.setTransactionId(transactionId);
         backgroundTask.setSequence(sequence);
+
+        backgroundTask.setUser(user);
+        backgroundTask.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
+
+        backgroundTask.setNature(Nature.BACKGROUND);
+
+        backgroundTask.setTargetClass(targetClassName);
+        backgroundTask.setTargetAction(targetActionName);
+        backgroundTask.setTargetStr(aim.getTarget().toString());
+        backgroundTask.setActionIdentifier(aim.getActionId());
+
+        backgroundTask.setArguments(targetArgs);
+        backgroundTask.setMemento(aim.asMementoString());
         
         reifiableAction.setReify(true);
         
         persist(backgroundTask);
     }
 
+
+
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
index 9fde6fc..25ab672 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
@@ -63,8 +63,7 @@ import org.apache.isis.objectstore.jdo.applib.service.Util;
                     + "WHERE transactionId == :transactionId")
 })
 @MemberGroupLayout(
-        //columnSpans={5,0,7},
-        left={"Identifiers","Detail"})
+        left={"Identifiers","Target","Detail"})
 @Immutable
 @ObjectType("IsisPublishedEvent")
 public class PublishedEventJdo implements HasTransactionId {
@@ -73,6 +72,47 @@ public class PublishedEventJdo implements HasTransactionId {
         QUEUED, PROCESSED
     }
     
+
+    // //////////////////////////////////////
+    // user (property)
+    // //////////////////////////////////////
+
+    private String user;
+    
+    @javax.jdo.annotations.Column(allowsNull="false", length=50)
+    @MemberOrder(name="Identifiers", sequence = "10")
+    @Hidden(where=Where.PARENTED_TABLES)
+    public String getUser() {
+        return user;
+    }
+    
+    public void setUser(final String user) {
+        this.user = user;
+    }
+    
+
+    // //////////////////////////////////////
+    // timestamp (property)
+    // //////////////////////////////////////
+
+    private java.sql.Timestamp timestamp;
+
+    @javax.jdo.annotations.Persistent
+    @javax.jdo.annotations.Column(allowsNull="false")
+    @MemberOrder(name="Identifiers", sequence = "20")
+    @Hidden(where=Where.PARENTED_TABLES)
+    public java.sql.Timestamp getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(final java.sql.Timestamp timestamp) {
+        this.timestamp = timestamp;
+    }
+    
+
+
+    // //////////////////////////////////////
+    // transactionId
     // //////////////////////////////////////
 
     private UUID transactionId;
@@ -86,7 +126,7 @@ public class PublishedEventJdo implements HasTransactionId {
      */
     @javax.jdo.annotations.PrimaryKey
     @javax.jdo.annotations.Column(allowsNull="false",length=JdoColumnLength.TRANSACTION_ID)
-    @MemberOrder(name="Identifiers", sequence = "10")
+    @MemberOrder(name="Identifiers", sequence = "30")
     @Hidden(where=Where.PARENTED_TABLES)
     @Override
     public UUID getTransactionId() {
@@ -113,7 +153,7 @@ public class PublishedEventJdo implements HasTransactionId {
      * primary key.
      */
     @javax.jdo.annotations.PrimaryKey
-    @MemberOrder(name="Identifiers", sequence = "20")
+    @MemberOrder(name="Identifiers", sequence = "40")
     public int getSequence() {
         return sequence;
     }
@@ -124,43 +164,6 @@ public class PublishedEventJdo implements HasTransactionId {
     
 
     // //////////////////////////////////////
-    // user (property)
-    // //////////////////////////////////////
-
-    private String user;
-    
-    @javax.jdo.annotations.Column(allowsNull="false", length=50)
-    @MemberOrder(name="Identifiers", sequence = "30")
-    @Hidden(where=Where.PARENTED_TABLES)
-    public String getUser() {
-        return user;
-    }
-    
-    public void setUser(final String user) {
-        this.user = user;
-    }
-    
-
-    // //////////////////////////////////////
-    // timestamp (property)
-    // //////////////////////////////////////
-
-    private java.sql.Timestamp timestamp;
-
-    @javax.jdo.annotations.Persistent
-    @javax.jdo.annotations.Column(allowsNull="false")
-    @MemberOrder(name="Identifiers", sequence = "40")
-    @Hidden(where=Where.PARENTED_TABLES)
-    public java.sql.Timestamp getTimestamp() {
-        return timestamp;
-    }
-
-    public void setTimestamp(final java.sql.Timestamp timestamp) {
-        this.timestamp = timestamp;
-    }
-    
-
-    // //////////////////////////////////////
     // title
     // //////////////////////////////////////
 
@@ -168,8 +171,8 @@ public class PublishedEventJdo implements HasTransactionId {
 
     @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.PublishedEvent.TITLE)
     @Title
-    @MemberOrder(name="Detail", sequence = "10")
-    @Named("Target")
+    @MemberOrder(name="Target", sequence = "10")
+    @Named("Object")
     public String getTitle() {
         return title;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
index 8d92b32..bacf55a 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
@@ -32,8 +32,8 @@ import org.slf4j.LoggerFactory;
 import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Disabled;
 import org.apache.isis.applib.annotation.Hidden;
+import org.apache.isis.applib.annotation.Immutable;
 import org.apache.isis.applib.annotation.MemberGroupLayout;
 import org.apache.isis.applib.annotation.MemberOrder;
 import org.apache.isis.applib.annotation.MultiLine;
@@ -54,7 +54,8 @@ import org.apache.isis.objectstore.jdo.applib.service.Util;
 
 @javax.jdo.annotations.PersistenceCapable(
         identityType=IdentityType.APPLICATION, 
-        table="IsisReifiableAction")
+        table="IsisReifiableAction",
+        objectIdClass=ReifiableActionJdoPK.class)
 @javax.jdo.annotations.Queries( {
     @javax.jdo.annotations.Query(
             name="findByTransactionId", language="JDOQL",  
@@ -79,7 +80,8 @@ import org.apache.isis.objectstore.jdo.applib.service.Util;
         columnSpans={6,0,6}, 
         left={"Identifiers","Target","Notes"},
         right={"Detail","Timings","Results"})
-@Named("Interaction")
+@Named("Reifiable Action")
+@Immutable
 public class ReifiableActionJdo implements ReifiableAction {
 
     @SuppressWarnings("unused")
@@ -87,37 +89,6 @@ public class ReifiableActionJdo implements ReifiableAction {
 
 
     // //////////////////////////////////////
-    // transactionId (property)
-    // //////////////////////////////////////
-
-        
-    private UUID transactionId;
-
-    /**
-     * The unique identifier (a GUID) of the transaction in which this action occurred.
-     */
-    @javax.jdo.annotations.PrimaryKey
-    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
-    @TypicalLength(JdoColumnLength.TRANSACTION_ID)
-    @MemberOrder(name="Identifiers",sequence = "10")
-    @Disabled
-    @Override
-    public UUID getTransactionId() {
-        return transactionId;
-    }
-
-    /**
-     * <b>NOT API</b>: intended to be called only by the framework.
-     * 
-     * <p>
-     * Implementation notes: copied over from the Isis transaction when the action is persisted.
-     */
-    @Override
-    public void setTransactionId(final UUID transactionId) {
-        this.transactionId = transactionId;
-    }
-
-    // //////////////////////////////////////
     // user (property)
     // //////////////////////////////////////
 
@@ -125,7 +96,7 @@ public class ReifiableActionJdo implements ReifiableAction {
 
     @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
     @Title(sequence="2", prepend=", ")
-    @MemberOrder(name="Identifiers", sequence = "20")
+    @MemberOrder(name="Identifiers", sequence = "10")
     public String getUser() {
         return user;
     }
@@ -147,7 +118,7 @@ public class ReifiableActionJdo implements ReifiableAction {
      */
     @javax.jdo.annotations.Persistent
     @javax.jdo.annotations.Column(allowsNull="false")
-    @MemberOrder(name="Timings", sequence = "30")
+    @MemberOrder(name="Identifiers", sequence = "20")
     public Timestamp getTimestamp() {
         return timestamp;
     }
@@ -158,6 +129,99 @@ public class ReifiableActionJdo implements ReifiableAction {
 
     
     
+    // //////////////////////////////////////
+    // nature (property)
+    // //////////////////////////////////////
+
+    private Nature nature;
+
+    /**
+     * Whether the action was invoked explicitly by the user, or scheduled as a background
+     * task, or as for some other reason, eg a side-effect of rendering an object due to 
+     * get-after-post).
+     */
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.NATURE)
+    @TypicalLength(30)
+    @MemberOrder(name="Identifiers", sequence = "30")
+    @Override
+    public Nature getNature() {
+        return nature;
+    }
+    
+    /**
+     * <b>NOT API</b>: intended to be called only by the framework.
+     * 
+     * <p>
+     * Implementation notes: populated by the viewer as hint to {@link ReifiableActionService} implementation.
+     */
+    @Override
+    public void setNature(Nature nature) {
+        this.nature = nature;
+    }
+
+
+    // //////////////////////////////////////
+    // transactionId (property)
+    // //////////////////////////////////////
+
+        
+    private UUID transactionId;
+
+    /**
+     * The unique identifier (a GUID) of the transaction in which this action occurred.
+     */
+    @javax.jdo.annotations.PrimaryKey
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
+    @TypicalLength(JdoColumnLength.TRANSACTION_ID)
+    @MemberOrder(name="Identifiers",sequence = "40")
+    @Override
+    public UUID getTransactionId() {
+        return transactionId;
+    }
+
+    /**
+     * <b>NOT API</b>: intended to be called only by the framework.
+     * 
+     * <p>
+     * Implementation notes: copied over from the Isis transaction when the action is persisted.
+     */
+    @Override
+    public void setTransactionId(final UUID transactionId) {
+        this.transactionId = transactionId;
+    }
+
+    
+    // //////////////////////////////////////
+    // sequence (property)
+    // //////////////////////////////////////
+
+    private int sequence;
+
+    /**
+     * The 0-based additional identifier of a published event within the given {@link #getTransactionId() transaction}.
+     * 
+     * <p>
+     * The combination of ({@link #getTransactionId() transactionId}, {@link #getSequence() sequence}) makes up the
+     * primary key.
+     * 
+     * <p>
+     * For {@link Nature#USER_INITIATED user-initiated} actions, this will always be <tt>0</tt>
+     */
+    @javax.jdo.annotations.PrimaryKey
+    @MemberOrder(name="Identifiers", sequence = "50")
+    public int getSequence() {
+        return sequence;
+    }
+
+    public void setSequence(final int sequence) {
+        this.sequence = sequence;
+    }
+    
+    public boolean hideSequence() {
+        return Nature.USER_INITIATED.equals(getNature());
+    }
+
+
 
     // //////////////////////////////////////
     // targetClass (property)
@@ -165,7 +229,7 @@ public class ReifiableActionJdo implements ReifiableAction {
 
     private String targetClass;
 
-    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_CLASS)
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.TARGET_CLASS)
     @TypicalLength(30)
     @MemberOrder(name="Target", sequence = "10")
     @Named("Class")
@@ -174,7 +238,7 @@ public class ReifiableActionJdo implements ReifiableAction {
     }
 
     public void setTargetClass(final String targetClass) {
-        this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.Interaction.TARGET_CLASS);
+        this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.ReifiableAction.TARGET_CLASS);
     }
 
 
@@ -184,7 +248,7 @@ public class ReifiableActionJdo implements ReifiableAction {
     
     private String targetAction;
     
-    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_ACTION)
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.TARGET_ACTION)
     @TypicalLength(30)
     @MemberOrder(name="Target", sequence = "20")
     @Named("Action")
@@ -193,7 +257,7 @@ public class ReifiableActionJdo implements ReifiableAction {
     }
     
     public void setTargetAction(final String targetAction) {
-        this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.Interaction.TARGET_ACTION);
+        this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.ReifiableAction.TARGET_ACTION);
     }
     
 
@@ -218,10 +282,9 @@ public class ReifiableActionJdo implements ReifiableAction {
     
     private String targetStr;
     @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
-    @Named("Target Bookmark")
     @Hidden(where=Where.ALL_TABLES)
-    @MemberOrder(name="Target", sequence="3")
-    @Disabled
+    @MemberOrder(name="Target", sequence="30")
+    @Named("Object")
     public String getTargetStr() {
         return targetStr;
     }
@@ -242,7 +305,27 @@ public class ReifiableActionJdo implements ReifiableAction {
         return getTarget() == null;
     }
 
+
+    // //////////////////////////////////////
+    // arguments (property)
+    // //////////////////////////////////////
+    
+    private String arguments;
+    
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ReifiableAction.ARGUMENTS)
+    @MultiLine(numberOfLines=6)
+    @Hidden(where=Where.ALL_TABLES)
+    @MemberOrder(name="Target",sequence = "40")
+    public String getArguments() {
+        return arguments;
+    }
+    
+    public void setArguments(final String arguments) {
+        this.arguments = Util.abbreviated(arguments, JdoColumnLength.ReifiableAction.ARGUMENTS);
+    }
+
     
+
     // //////////////////////////////////////
     // actionIdentifier (property)
     // //////////////////////////////////////
@@ -265,25 +348,25 @@ public class ReifiableActionJdo implements ReifiableAction {
 
 
     // //////////////////////////////////////
-    // arguments (property)
+    // memento (property)
     // //////////////////////////////////////
     
-    private String arguments;
+    private String memento;
     
-    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.ARGUMENTS)
-    @MultiLine(numberOfLines=6)
+    @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BackgroundTask.MEMENTO)
+    @MultiLine(numberOfLines=10)
     @Hidden(where=Where.ALL_TABLES)
-    @MemberOrder(name="Detail",sequence = "4")
-    @Disabled
-    public String getArguments() {
-        return arguments;
+    @MemberOrder(name="Detail",sequence = "30")
+    public String getMemento() {
+        return memento;
     }
     
-    public void setArguments(final String arguments) {
-        this.arguments = Util.abbreviated(arguments, JdoColumnLength.Interaction.ARGUMENTS);
+    public void setMemento(final String memento) {
+        this.memento = memento;
     }
 
 
+
     // //////////////////////////////////////
     // startedAt (derived property)
     // //////////////////////////////////////
@@ -293,7 +376,6 @@ public class ReifiableActionJdo implements ReifiableAction {
      */
     @javax.jdo.annotations.NotPersistent
     @MemberOrder(name="Timings", sequence = "3")
-    @Disabled
     public Timestamp getStartedAt() {
         return getTimestamp();
     }
@@ -317,7 +399,6 @@ public class ReifiableActionJdo implements ReifiableAction {
     @javax.jdo.annotations.Persistent
     @javax.jdo.annotations.Column(allowsNull="true")
     @MemberOrder(name="Timings", sequence = "4")
-    @Disabled
     public Timestamp getCompletedAt() {
         return completedAt;
     }
@@ -347,61 +428,19 @@ public class ReifiableActionJdo implements ReifiableAction {
 
 
     // //////////////////////////////////////
-    // notes (property)
-    // //////////////////////////////////////
-
-    private String notes;
-
-    /**
-     * Provides the ability for the end-user to annotate a (potentially long-running)
-     * interaction.
-     * 
-     * <p>
-     * Not part of the applib API, because the default implementation is not persistent
-     * and so there's no object that can be accessed to be annotated.
-     */
-    @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.NOTES)
-    @MultiLine(numberOfLines=10)
-    @Hidden(where=Where.ALL_TABLES)
-    @MemberOrder(name="Notes", sequence = "6")
-    public String getNotes() {
-        return notes;
-    }
-
-    public void setNotes(final String notes) {
-        this.notes = notes;
-    }
-
-
-    // //////////////////////////////////////
-    // nature (property)
+    // complete (derived property)
     // //////////////////////////////////////
+    
 
-    private Nature nature;
-
-    /**
-     * Not persisted, used as a hint that an action was invoked explicitly by the user
-     * (rather than as a side-effect, eg of rendering an object due to get-after-post).
-     */
     @javax.jdo.annotations.NotPersistent
-    @Programmatic
-    @Override
-    public Nature getNature() {
-        return nature;
-    }
-    
-    /**
-     * <b>NOT API</b>: intended to be called only by the framework.
-     * 
-     * <p>
-     * Implementation notes: populated by the viewer as hint to {@link ReifiableActionService} implementation.
-     */
-    @Override
-    public void setNature(Nature nature) {
-        this.nature = nature;
+    @MemberOrder(name="Timings", sequence = "8")
+    @Hidden(where=Where.OBJECT_FORMS)
+    public boolean isComplete() {
+        return getCompletedAt() != null;
     }
 
     
+    
     // //////////////////////////////////////
     // result (property)
     // openResultObject (action)
@@ -427,7 +466,6 @@ public class ReifiableActionJdo implements ReifiableAction {
     @Hidden(where=Where.ALL_TABLES)
     @Named("Result Bookmark")
     @MemberOrder(name="Results", sequence="25")
-    @Disabled
     public String getResultStr() {
         return resultStr;
     }
@@ -466,7 +504,7 @@ public class ReifiableActionJdo implements ReifiableAction {
      * Not part of the applib API, because the default implementation is not persistent
      * and so there's no object that can be accessed to be annotated.
      */
-    @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.EXCEPTION)
+    @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.ReifiableAction.EXCEPTION)
     @Hidden
     @Override
     public String getException() {
@@ -475,7 +513,7 @@ public class ReifiableActionJdo implements ReifiableAction {
 
     @Override
     public void setException(final String exception) {
-        this.exception = Util.abbreviated(exception, JdoColumnLength.Interaction.EXCEPTION);
+        this.exception = Util.abbreviated(exception, JdoColumnLength.ReifiableAction.EXCEPTION);
     }
     
     

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoPK.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoPK.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoPK.java
new file mode 100644
index 0000000..3d3479d
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoPK.java
@@ -0,0 +1,102 @@
+/*
+ *  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.
+ */
+package org.apache.isis.objectstore.jdo.applib.service.reifiableaction;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+import java.util.UUID;
+
+public class ReifiableActionJdoPK implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String SEPARATOR = "_";
+
+    public UUID transactionId;
+    public int sequence;
+
+    // //////////////////////////////////////
+
+    
+    public ReifiableActionJdoPK() {
+    }
+    
+    public ReifiableActionJdoPK(final String value) {
+        final StringTokenizer token = new StringTokenizer (value, SEPARATOR);
+        this.transactionId = UUID.fromString(token.nextToken());
+        this.sequence = Integer.parseInt(token.nextToken());
+    }
+
+    // //////////////////////////////////////
+
+    public UUID getTransactionId() {
+        return transactionId;
+    }
+    public void setTransactionId(UUID transactionId) {
+        this.transactionId = transactionId;
+    }
+    
+    // //////////////////////////////////////
+
+    public int getSequence() {
+        return sequence;
+    }
+    public void setSequence(int sequence) {
+        this.sequence = sequence;
+    }
+    
+    // //////////////////////////////////////
+
+    
+    
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + sequence;
+        result = prime * result + ((transactionId == null) ? 0 : transactionId.hashCode());
+        return result;
+    }
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        ReifiableActionJdoPK other = (ReifiableActionJdoPK) obj;
+        if (sequence != other.sequence)
+            return false;
+        if (transactionId == null) {
+            if (other.transactionId != null)
+                return false;
+        } else if (!transactionId.equals(other.transactionId))
+            return false;
+        return true;
+    }
+    
+    // //////////////////////////////////////
+
+    
+    @Override
+    public String toString() {
+        return transactionId + SEPARATOR + sequence;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
index e64b6eb..af7631c 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
@@ -35,13 +35,13 @@ public class ReifiableActionServiceJdo extends AbstractService implements Reifia
     /**
      * Creates an {@link ReifiableActionJdo}, initializing its 
      * {@link ReifiableAction#setNature(ReifiableAction.Nature) nature} to be
-     * {@link ReifiableAction.Nature#INDIRECT rendering}.
+     * {@link ReifiableAction.Nature#OTHER rendering}.
      */
     @Programmatic
     @Override
     public ReifiableAction create() {
         ReifiableActionJdo reifiableAction = newTransientInstance(ReifiableActionJdo.class);
-        reifiableAction.setNature(ReifiableAction.Nature.INDIRECT);
+        reifiableAction.setNature(ReifiableAction.Nature.OTHER);
         return reifiableAction;
     }
 
@@ -90,4 +90,8 @@ public class ReifiableActionServiceJdo extends AbstractService implements Reifia
         } 
         return reifiableActionJdo;
     }
+    
+    
+    
+    
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
index 14c9a93..652a27f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
@@ -28,14 +28,18 @@ public class ActionInvocationMemento {
 
     private final Memento memento;
 
-    public ActionInvocationMemento(final MementoService mementoService, String user, final String actionId, final Bookmark target, List<Class<?>> argTypes, List<Object> args) {
+    public ActionInvocationMemento(
+            final MementoService mementoService, 
+            final String actionId, 
+            final Bookmark target, List<Class<?>> argTypes,
+            final List<Object> args) {
+        
         if(argTypes.size() != args.size()) {
             throw new IllegalArgumentException("argTypes and args must be same size");
         }
         
         this.memento = mementoService.create();
         memento.set("actionId", actionId);
-        memento.set("user", user);
         memento.set("target", target);
         memento.set("numArgs", args.size());
         
@@ -60,8 +64,12 @@ public class ActionInvocationMemento {
         return memento.get("actionId", String.class);
     }
     
-    public String getUser() {
-        return memento.get("user", String.class);
+    public String getTargetClassName() {
+        return memento.get("targetClassName", String.class);
+    }
+    
+    public String getTargetActionName() {
+        return memento.get("targetActionName", String.class);
     }
     
     public Bookmark getTarget() {

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
index f36ca12..7a813fc 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
@@ -1,5 +1,9 @@
 package org.apache.isis.applib.services.background;
 
+import java.lang.reflect.Method;
+
+import org.apache.isis.applib.annotation.Programmatic;
+
 /**
  * Submit actions to be invoked in the background.
  * 
@@ -22,5 +26,10 @@ public interface BackgroundService {
      * Returns a proxy around the object which is then used to obtain the
      * signature of the action to be invoked in the background.
      */
+    @Programmatic
     <T> T execute(final T object);
+    
+    @Programmatic
+    ActionInvocationMemento asActionInvocationMemento(Method m, Object domainObject, Object[] args);
+
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
index e1c6ffe..6cca4c5 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
@@ -1,5 +1,7 @@
 package org.apache.isis.applib.services.background;
 
+import java.lang.reflect.Method;
+
 import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
 
 
@@ -14,5 +16,8 @@ import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
  */
 public interface BackgroundTaskService {
 
-    void execute(final ActionInvocationMemento aim, final ReifiableAction reifiableAction);
+    void schedule(
+            final ActionInvocationMemento aim, 
+            final ReifiableAction reifiableAction, 
+            final String targetClassName, final String targetActionName, final String targetArgs);
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
index 70af531..23a4f06 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
@@ -20,10 +20,13 @@ import java.sql.Timestamp;
 
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.annotation.Disabled;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.MemberOrder;
 import org.apache.isis.applib.annotation.Reified;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.clock.Clock;
 import org.apache.isis.applib.services.HasTransactionId;
+import org.apache.isis.applib.services.background.BackgroundService;
 import org.apache.isis.applib.services.background.BackgroundTaskService;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
@@ -31,6 +34,26 @@ import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionServic
 
 public interface ReifiableAction extends HasTransactionId {
 
+    
+    // //////////////////////////////////////
+
+    /**
+     * The 0-based additional identifier of an action within the given {@link #getTransactionId() transaction}.
+     * 
+     * <p>
+     * The combination of ({@link #getTransactionId() transactionId}, {@link #getSequence() sequence}) makes up the
+     * primary key.
+     * 
+     * <p>
+     * For {@link Nature#USER_INITIATED user-initiated} actions, this will always take the value <tt>0</tt>.
+     */
+    public int getSequence();
+
+    public void setSequence(final int sequence);
+
+
+    // //////////////////////////////////////
+
     /**
      * The user that initiated the action.
      */
@@ -142,27 +165,51 @@ public interface ReifiableAction extends HasTransactionId {
      * <b>NOT API</b>: intended to be called only by the framework.
      * 
      * <p>
-     * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
+     * Implementation notes: set when the action is invoked (in the <tt>ActionInvocationFacet</tt>).
      */
     public void setArguments(final String arguments);
 
+    
+    // //////////////////////////////////////
+
+    /**
+     * A formal (XML or similar) specification of the action to invoke/being invoked.
+     */
+    public String getMemento();
+    
+    /**
+     * <b>NOT API</b>: intended to be called only by the framework.
+     * 
+     * <p>
+     * Implementation notes: set when the action is invoked (in the <tt>ActionInvocationFacet</tt>).
+     */
+    public void setMemento(final String memento);
+
     // //////////////////////////////////////
     
     public static enum Nature {
         /**
-         * Indicates that the {@link UserAction} has occurred as the result of an explicit action invocation
+         * Action has occurred as the result of an explicit action invocation
          * on the part of the user.
          */
         USER_INITIATED,
-        INDIRECT
+        /**
+         * Action is run by virtue of being previously scheduled as a background through
+         * the {@link BackgroundService} and {@link BackgroundTaskService}.
+         */
+        BACKGROUND,
+        /**
+         * Indicates that the action has been run for some other reason.
+         */
+        OTHER
     }
 
     /**
      * The nature of this action, for example whether it was
      * {@link #USER_INITIATED user initiated} on the part of the user, or merely as
-     * a {@link #INDIRECT indirect} side-effect, eg the re-rendering of an entity in a viewer (such as the
+     * a {@link #OTHER other} (typically indirect) side-effect, eg the re-rendering of an entity in a viewer (such as the
      * Wicket viewer) that uses the <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">post/redirect/get</a>
-     * to avoid duplicate submissions.
+     * to avoid duplicate submissions, or the action nominated as the {@link HomePage} action.
      * 
      * <p>
      * The Isis implementations uses this field as to a hint as to whether to populate the interaction's

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
index bb8b64f..0ecf48e 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
@@ -30,7 +30,7 @@ import org.apache.isis.applib.util.ObjectContracts;
 public class ReifiableActionDefault implements ReifiableAction {
 
     public ReifiableActionDefault() {
-        setNature(ReifiableAction.Nature.INDIRECT);
+        setNature(ReifiableAction.Nature.OTHER);
     }
     
     // //////////////////////////////////////
@@ -88,6 +88,23 @@ public class ReifiableActionDefault implements ReifiableAction {
         this.arguments = arguments;
     }
     
+    
+    // //////////////////////////////////////
+    // memento (property)
+    // //////////////////////////////////////
+    
+    private String memento;
+    
+    @Override
+    public String getMemento() {
+        return memento;
+    }
+    @Override
+    public void setMemento(String memento) {
+        this.memento = memento;
+    }
+    
+
     // //////////////////////////////////////
     // target (property)
     // //////////////////////////////////////
@@ -225,9 +242,28 @@ public class ReifiableActionDefault implements ReifiableAction {
     
     // //////////////////////////////////////
     
-    public void setReify(boolean reifyHint) {
-        // no-op
+    private boolean reify;
+    
+    public boolean isReify() {
+        return reify;
+    }
+    
+    public void setReify(boolean reify) {
+        this.reify = reify;
     }
     
     
+    // //////////////////////////////////////
+    
+    private int sequence;
+    
+    @Override
+    public int getSequence() {
+        return sequence;
+    }
+    
+    @Override
+    public void setSequence(int sequence) {
+        this.sequence = sequence;
+    }
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
index e5f376c..72fb21c 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
@@ -449,7 +449,7 @@ public class ObjectSpecificationDefault extends ObjectSpecificationAbstract impl
     }
 
     private void catalogueActions(final Map<Method, ObjectMember> membersByMethod) {
-        final List<ObjectAction> userActions = getObjectActions(ActionType.USER, Contributed.INCLUDED, Filters.<ObjectAction>any());
+        final List<ObjectAction> userActions = getObjectActions(Contributed.INCLUDED);
         for (int i = 0; i < userActions.size(); i++) {
             final ObjectAction userAction = userActions.get(i);
             final List<Facet> facets = userAction.getFacets(ImperativeFacet.FILTER);

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
index ddf7efb..9161e23 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
@@ -19,20 +19,27 @@
 
 package org.apache.isis.core.progmodel.facets.actions.invoke;
 
+import java.awt.Desktop.Action;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.List;
 
+import com.google.common.collect.Lists;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.isis.applib.annotation.Bulk;
 import org.apache.isis.applib.annotation.Bulk.InteractionContext.InvokedAs;
+import org.apache.isis.applib.services.background.ActionInvocationMemento;
+import org.apache.isis.applib.services.background.BackgroundService;
 import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.memento.MementoService;
 import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
 import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
-import org.apache.isis.core.commons.lang.StringExtensions;
+import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.lang.ThrowableExtensions;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
@@ -50,7 +57,6 @@ import org.apache.isis.core.metamodel.facets.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.specloader.ReflectiveActionException;
 import org.apache.isis.core.progmodel.facets.actions.bulk.BulkFacet;
 
@@ -134,34 +140,32 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
             }
 
 
-            if(reifiableAction != null) {
-                if(reifiableAction.getNature() == ReifiableAction.Nature.USER_INITIATED && owningAction != null) {
-
-                    final String actionIdentifier = owningAction.getIdentifier().toClassAndNameIdentityString();
-                    reifiableAction.setActionIdentifier(actionIdentifier);
-                    
-                    String targetClassName = StringExtensions.asNaturalName2(targetAdapter.getSpecification().getSingularName());
-                    String actionName = owningAction.getName();
-                    reifiableAction.setTargetClass(targetClassName);
-                    reifiableAction.setTargetAction(actionName);
-                    
-                    final StringBuilder argsBuf = new StringBuilder();
-                    List<ObjectActionParameter> parameters = owningAction.getParameters();
-                    if(parameters.size() == arguments.length) {
-                        // should be the case
-                        int i=0;
-                        for (ObjectActionParameter param : parameters) {
-                            appendParamArg(argsBuf, param, arguments[i++]);
-                        }
-                    }
-                    reifiableAction.setArguments(argsBuf.toString());
+            if(reifiableAction != null && reifiableAction.getNature() == ReifiableAction.Nature.USER_INITIATED && owningAction != null) {
 
-                    final boolean reifiable = getFacetHolder().containsDoOpFacet(ReifiedActionFacet.class);
-                    reifiableAction.setReify(reifiable);
-                }
+                reifiableAction.setActionIdentifier(ReifiableActionUtil.actionIdentifierFor(owningAction));
+                reifiableAction.setTargetClass(ReifiableActionUtil.targetClassNameFor(targetAdapter));
+                reifiableAction.setTargetAction(ReifiableActionUtil.targetActionNameFor(owningAction));
+                reifiableAction.setArguments(ReifiableActionUtil.argDescriptionFor(owningAction, arguments));
                 
-                final Bookmark bookmark = bookmarkFor(targetAdapter);
-                reifiableAction.setTarget(bookmark);
+                final Bookmark targetBookmark = ReifiableActionUtil.bookmarkFor(targetAdapter);
+                reifiableAction.setTarget(targetBookmark);
+                
+                
+                final BackgroundService backgroundService = getServicesInjector().lookupService(BackgroundService.class);
+                if(backgroundService != null) {
+                    final Object targetObject = unwrap(targetAdapter);
+                    final Object[] args = ReifiableActionUtil.objectsFor(arguments);
+                    ActionInvocationMemento aim = backgroundService.asActionInvocationMemento(method, targetObject, args);
+
+                    if(aim != null) {
+                        reifiableAction.setMemento(aim.asMementoString());
+                    } else {
+                        throw new IsisException("Unable to build memento for action " + owningAction.getIdentifier().toClassAndNameIdentityString());
+                    }
+                }
+
+                final boolean reifiable = getFacetHolder().containsDoOpFacet(ReifiedActionFacet.class);
+                reifiableAction.setReify(reifiable);
             }
             
             final Object result = method.invoke(object, executionParameters);
@@ -182,7 +186,7 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
             
             if(reifiableAction != null) {
                 if(!resultAdapter.getSpecification().containsDoOpFacet(ViewModelFacet.class)) {
-                    final Bookmark bookmark = bookmarkFor(resultAdapter);
+                    final Bookmark bookmark = ReifiableActionUtil.bookmarkFor(resultAdapter);
                     reifiableAction.setResult(bookmark);
                 }
             }
@@ -208,21 +212,6 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
             throw new ReflectiveActionException("Illegal access of " + method, e);
         }
     }
-    
-
-    private static Bookmark bookmarkFor(final ObjectAdapter resultAdapter) {
-        final Oid oid = resultAdapter.getOid();
-        if(!(oid instanceof RootOid)) {
-            return null;
-        } 
-        final RootOid rootOid = (RootOid) oid;
-        return rootOid.asBookmark();
-    }
-
-    private void appendParamArg(final StringBuilder buf, ObjectActionParameter param, ObjectAdapter objectAdapter) {
-        String titleOf = objectAdapter != null? objectAdapter.titleString(null): "null";
-        buf.append(param.getName()).append(": ").append(titleOf).append("\n");
-    }
 
     private static Object unwrap(final ObjectAdapter adapter) {
         return adapter == null ? null : adapter.getObject();

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ReifiableActionUtil.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ReifiableActionUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ReifiableActionUtil.java
new file mode 100644
index 0000000..cead05a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ReifiableActionUtil.java
@@ -0,0 +1,121 @@
+/*
+ *  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.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.invoke;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.memento.MementoService;
+import org.apache.isis.core.commons.lang.StringExtensions;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
+import org.apache.isis.core.metamodel.adapter.oid.Oid;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
+
+
+/**
+ * Factoring out the commonality between {@link ActionInvocationFacetViaMethod} and <tt>BackgroundServiceDefault</tt>.
+ */
+public class ReifiableActionUtil {
+
+    
+    private ReifiableActionUtil(){}
+
+    public static String targetActionNameFor(ObjectAction owningAction) {
+        return owningAction.getName();
+    }
+
+    public static String targetClassNameFor(ObjectAdapter targetAdapter) {
+        return StringExtensions.asNaturalName2(targetAdapter.getSpecification().getSingularName());
+    }
+
+    public static String actionIdentifierFor(ObjectAction owningAction) {
+        return owningAction.getIdentifier().toClassAndNameIdentityString();
+    }
+
+    public static String argDescriptionFor(ObjectAction owningAction, ObjectAdapter[] arguments) {
+        final StringBuilder argsBuf = new StringBuilder();
+        List<ObjectActionParameter> parameters = owningAction.getParameters();
+        if(parameters.size() == arguments.length) {
+            // should be the case
+            int i=0;
+            for (ObjectActionParameter param : parameters) {
+                ReifiableActionUtil.appendParamArg(argsBuf, param, arguments[i++]);
+            }
+        }
+        String argsStr = argsBuf.toString();
+        return argsStr;
+    }
+
+    public static Bookmark bookmarkFor(final ObjectAdapter adapter) {
+        final Oid oid = adapter.getOid();
+        if(!(oid instanceof RootOid)) {
+            return null;
+        } 
+        final RootOid rootOid = (RootOid) oid;
+        return rootOid.asBookmark();
+    }
+
+    static void appendParamArg(final StringBuilder buf, ObjectActionParameter param, ObjectAdapter objectAdapter) {
+        String titleOf = objectAdapter != null? objectAdapter.titleString(null): "null";
+        buf.append(param.getName()).append(": ").append(titleOf).append("\n");
+    }
+
+    public static void buildMementoArgLists(MementoService mementoService, BookmarkService bookmarkService, final Method method, final Object[] args, final List<Class<?>> argTypes, final List<Object> argObjs) {
+        for (int i = 0; i < args.length; i++) {
+            Object input = args[i];
+            if (mementoService.canSet(input)) {
+                argTypes.add(method.getParameterTypes()[i]);
+                argObjs.add(input);
+            } else {
+                Bookmark argBookmark = bookmarkService.bookmarkFor(input);
+                argTypes.add(Bookmark.class);
+                argObjs.add(argBookmark);
+            }
+        }
+    }
+    
+    
+    public static ObjectAdapter[] adaptersFor(final Object[] args, final AdapterManager adapterManager) {
+        List<Object> argList = Arrays.asList(args);
+        Iterable<ObjectAdapter> adapterList = 
+                Iterables.transform(
+                        argList, ObjectAdapter.Functions.adapterForUsing(adapterManager));
+        return Lists.newArrayList(adapterList).toArray(new ObjectAdapter[]{});
+    }
+
+    public static Object[] objectsFor(ObjectAdapter[] arguments) {
+        List<ObjectAdapter> argList = Arrays.asList(arguments);
+        Iterable<Object> adapterList = 
+                Iterables.transform(
+                        argList, ObjectAdapter.Functions.getObject());
+        return Lists.newArrayList(adapterList).toArray(new Object[]{});
+    }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
index b247ddf..17cf1ee 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
@@ -5,6 +5,7 @@ import static org.hamcrest.CoreMatchers.not;
 import static org.hamcrest.CoreMatchers.nullValue;
 
 import java.lang.reflect.Method;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -16,6 +17,7 @@ import javassist.util.proxy.ProxyObject;
 
 import javax.annotation.PostConstruct;
 
+import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
 import org.apache.isis.applib.annotation.Programmatic;
@@ -30,19 +32,23 @@ import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.lang.ArrayExtensions;
+import org.apache.isis.core.commons.lang.StringExtensions;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
 import org.apache.isis.core.metamodel.specloader.classsubstitutor.JavassistEnhanced;
 import org.apache.isis.core.metamodel.specloader.specimpl.dflt.ObjectSpecificationDefault;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ReifiableActionUtil;
 import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
 import org.apache.isis.core.runtime.system.context.IsisContext;
 
 public class BackgroundServiceDefault implements BackgroundService {
 
     private final MementoServiceDefault mementoService;
-
+    
     public BackgroundServiceDefault() {
         this(new MementoServiceDefault());
     }
@@ -134,6 +140,7 @@ public class BackgroundServiceDefault implements BackgroundService {
                     return proxyMethod.invoke(domainObject, args);
                 }
 
+                final ObjectAdapter targetAdapter = getAdapterManager().adapterFor(domainObject);
                 final ObjectSpecificationDefault targetObjSpec = getJavaSpecificationOfOwningClass(proxyMethod);
                 final ObjectMember member = targetObjSpec.getMember(proxyMethod);
 
@@ -148,38 +155,73 @@ public class BackgroundServiceDefault implements BackgroundService {
                 }
 
                 final ObjectAction action = (ObjectAction) member;
-                final String actionId = action.getIdentifier().toFullIdentityString();
+
+                final String actionIdentifier = ReifiableActionUtil.actionIdentifierFor(action);
+                final String targetClassName = ReifiableActionUtil.targetClassNameFor(targetAdapter);
+                final String targetActionName = ReifiableActionUtil.targetActionNameFor(action);
+                final String targetArgs = ReifiableActionUtil.argDescriptionFor(action, adaptersFor(args));
                 
                 final Bookmark domainObjectBookmark = bookmarkService.bookmarkFor(domainObject);
 
                 final List<Class<?>> argTypes = Lists.newArrayList();
                 final List<Object> argObjs = Lists.newArrayList();
-                for (int i = 0; i < args.length; i++) {
-                    Object input = args[i];
-                    if (mementoService.canSet(input)) {
-                        argTypes.add(proxiedMethod.getParameterTypes()[i]);
-                        argObjs.add(input);
-                    } else {
-                        Bookmark argBookmark = bookmarkService.bookmarkFor(input);
-                        argTypes.add(Bookmark.class);
-                        argObjs.add(argBookmark);
-                    }
-                }
+                ReifiableActionUtil.buildMementoArgLists(mementoService, bookmarkService, proxiedMethod, args, argTypes, argObjs);
 
                 final ReifiableAction reifiableAction = reifiableActionContext.getReifiableAction();
                 
                 final ActionInvocationMemento aim = 
-                        new ActionInvocationMemento(mementoService, reifiableAction.getUser(), 
-                                actionId, domainObjectBookmark, argTypes, argObjs);
-
+                        new ActionInvocationMemento(mementoService, 
+                                actionIdentifier, 
+                                domainObjectBookmark,
+                                argTypes,
+                                argObjs);
                
-                backgroundTaskService.execute(aim, reifiableAction);
+                backgroundTaskService.schedule(aim, reifiableAction, targetClassName, targetActionName, targetArgs);
                 
                 return null;
             }
+
+            ObjectAdapter[] adaptersFor(final Object[] args) {
+                final AdapterManager adapterManager = getAdapterManager();
+                return ReifiableActionUtil.adaptersFor(args, adapterManager);
+            }
+
         };
     }
 
+    @Override
+    public ActionInvocationMemento asActionInvocationMemento(Method method, Object domainObject, Object[] args) {
+        
+        final ObjectSpecificationDefault targetObjSpec = getJavaSpecificationOfOwningClass(method);
+        final ObjectMember member = targetObjSpec.getMember(method);
+        if(member == null) {
+            return null;
+        }
+        if(!(member instanceof ObjectAction)) {
+            return null;
+        }
+
+        final ObjectAction action = (ObjectAction) member;
+        final String actionIdentifier = ReifiableActionUtil.actionIdentifierFor(action);
+        
+        final Bookmark domainObjectBookmark = bookmarkService.bookmarkFor(domainObject);
+
+        final List<Class<?>> argTypes = Lists.newArrayList();
+        final List<Object> argObjs = Lists.newArrayList();
+        ReifiableActionUtil.buildMementoArgLists(mementoService, bookmarkService, method, args, argTypes, argObjs);
+
+        final ActionInvocationMemento aim = 
+                new ActionInvocationMemento(mementoService, 
+                        actionIdentifier, 
+                        domainObjectBookmark,
+                        argTypes,
+                        argObjs);
+       
+        return aim;
+    }
+
+    
+    
     // //////////////////////////////////////
 
     private BookmarkService bookmarkService;
@@ -214,5 +256,9 @@ public class BackgroundServiceDefault implements BackgroundService {
         return IsisContext.getSpecificationLoader();
     }
 
+    protected AdapterManager getAdapterManager() {
+        return IsisContext.getPersistenceSession().getAdapterManager();
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/af78da45/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
deleted file mode 100644
index c1df087..0000000
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- *  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.
- */
-package org.apache.isis.core.runtime.services.background;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-
-import java.lang.reflect.Method;
-import java.util.UUID;
-
-import com.google.common.base.Objects;
-
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.hamcrest.TypeSafeMatcher;
-import org.jmock.Expectations;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
-import org.apache.isis.applib.services.background.BackgroundTaskService;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
-import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
-import org.apache.isis.applib.services.reifiableaction.ReifiableActionDefault;
-import org.apache.isis.core.commons.matchers.IsisMatchers;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.specloader.specimpl.dflt.ObjectSpecificationDefault;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-public class BackgroundServiceDefaultTest_execute {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    @Mock
-    private BookmarkService mockBookmarkService;
-
-    @Mock
-    private SpecificationLoaderSpi mockSpecificationLoaderSpi;
-    @Mock
-    private ObjectSpecificationDefault mockSpec;
-    @Mock
-    private ObjectAction mockAction;
-    private Identifier actionIdentifier;
-    
-    @Mock
-    private ReifiableActionContext mockReifiableActionContext;
-
-    private ReifiableAction reifiableAction;
-    private UUID transactionId = UUID.randomUUID();
-    
-    @Mock
-    private BackgroundTaskService mockBackgroundTaskService;
-
-    
-
-    static class Product {}
-    static class Order {
-        Product product;
-        int quantity;
-
-        public Order(Product product, int quantity) {
-            this.product = product;
-            this.quantity = quantity;
-        }
-    }
-    static class Customer {
-        public Order placeOrder(Product product, int quantity, String comment) {
-            return new Order(product, quantity);
-        }
-    }
-    private Customer customer;
-    private Product product;
-
-    private BackgroundServiceDefault backgroundService;
-
-
-    @Before
-    public void setUp() throws Exception {
-        backgroundService = new BackgroundServiceDefault() {
-            @Override
-            protected SpecificationLoaderSpi getSpecificationLoader() {
-                return mockSpecificationLoaderSpi;
-            }
-        };
-        backgroundService.injectBookmarkService(mockBookmarkService);
-        backgroundService.injectReifiableActionContext(mockReifiableActionContext);
-        backgroundService.injectBackgroundTaskService(mockBackgroundTaskService);
-
-        reifiableAction = new ReifiableActionDefault();
-        reifiableAction.setTransactionId(transactionId);
-        reifiableAction.setUser("fbloggs");
-        reifiableAction.setTransactionId(transactionId);
-        
-        context.checking(new Expectations() {
-            {
-                allowing(mockSpecificationLoaderSpi).loadSpecification(with(IsisMatchers.anySubclassOf(Customer.class)));
-                will(returnValue(mockSpec));
-                
-                allowing(mockSpec).getFullIdentifier();
-                will(returnValue(Customer.class.getName()));
-                
-                allowing(mockReifiableActionContext).getReifiableAction();
-                will(returnValue(reifiableAction));
-            }
-        });
-        customer = new Customer();
-        product = new Product();
-        actionIdentifier = Identifier.actionIdentifier(Customer.class, "placeOrder", Product.class, int.class);
-    }
-    
-    @Test
-    public void happy() {
-        final Bookmark cusBookmark = new Bookmark("CUS", "456");
-        final Bookmark prdBookmark = new Bookmark("PRD", "123");
-
-        context.checking(new Expectations() {
-            {
-                allowing(mockSpec).getMember(with(any(Method.class)));
-                will(returnValue(mockAction));
-                
-                allowing(mockAction).getIdentifier();
-                will(returnValue(actionIdentifier));
-
-                oneOf(mockBookmarkService).bookmarkFor(with(any(Customer.class))); // will be the proxy
-                will(returnValue(cusBookmark));
-                
-                oneOf(mockBookmarkService).bookmarkFor(product);
-                will(returnValue(prdBookmark));
-                
-                oneOf(mockBackgroundTaskService).execute(
-                        with(x()), 
-                        with(equalTo(reifiableAction)));
-            }
-
-            protected Matcher<ActionInvocationMemento> x() {
-                return new TypeSafeMatcher<ActionInvocationMemento>() {
-
-                    @Override
-                    public void describeTo(Description description) {
-                        description.appendText("all sorted");
-                    }
-
-                    @Override
-                    protected boolean matchesSafely(ActionInvocationMemento item) {
-                        try {
-                            return item.getActionId().equals("org.apache.isis.core.runtime.services.background.BackgroundServiceDefaultTest_execute.Customer#placeOrder(org.apache.isis.core.runtime.services.background.BackgroundServiceDefaultTest_execute$Product,int)")
-                                    && item.getUser().equals("fbloggs")
-                                    && item.getTarget().toString().equals("CUS:456")
-                                    && item.getNumArgs() == 3
-                                    && item.getArgType(0).equals(Bookmark.class)
-                                    && item.getArg(0, Bookmark.class).toString().equals("PRD:123")
-                                    && item.getArgType(1).equals(int.class)
-                                    && item.getArg(1, int.class) == 3
-                                    && item.getArgType(2).equals(String.class)
-                                    && Objects.equal(item.getArg(2, String.class), null)
-                                    ;
-                        } catch (ClassNotFoundException e) {
-                            return false;
-                        }
-                    }
-                };
-            }
-        });
-        backgroundService.execute(customer).placeOrder(product, 3, null);
-    }
-}