I am wondering if there are any indicators I can use within the following Event System code to know whether the Publish Transaction was triggered by XPM vs. a user?

The only things I've found (which are not conclusive at all) is Component being published to Staging

private void SetInWorkflowPublishFlag(IdentifiableObject subject, PublishEventArgs args, EventPhases phase)
   //TODO: Review if can determine if initiated by XPM vs. Person
   if (args.Targets.Count() == 1 && args.Targets.First().Title.ToLower().Contains("staging"))
      if(subject is Component)
         args.PublishInstruction.ResolveInstruction.IncludeWorkflow = true;
  • There might be something in the ContextData dictionary. I know you'll find stuff in there like if it's an action caused by Content Porter or Translation Manager. Do not know if we had Experience Manager/CME identified already in 2013 though.
    – Nuno Linhares
    Commented Sep 28, 2016 at 10:37
  • I tried the ContextData, it was empty Commented Sep 29, 2016 at 11:16
  • 1
    Sorry. Might have been added in 8.1 only then.
    – Nuno Linhares
    Commented Sep 29, 2016 at 11:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.