1

We are seeing an issue that when a template has a RAZOR TBB with an import:

@importRazor("ContextLookupRCTBB.cshtml")

Workflow can be started on the imported RAZOR TBB, but the in workflow version of the imported TBB is not being used during preview or publishing with the workflow option checked. Is there a way for this import used in the main TBB to be ran/published with the workflow version?

1 Answer 1

1

In the Razor mediator, imports are essentially a text replace before the containing template gets compiled. To get a new version of the include to be used, you need to ensure that the mediator "realises" that the including template needs to be recompiled because the current cached version is out of date. There are two main approaches to this:

  1. Update the containing template with some trivial change (easiest is to update the Title, Save, Change the title back, Save and close)
  2. Restart the process that hosts the Mediator and its cache. When publishing, this will be the publisher. When previewing, it will be the service host. (Knowing that preview's cache is distinct from the publisher's cache will save you much grief.)

Edit: You should also be aware that the mediator can be configured to impersonate another user when loading dependencies. In this scenario, only the checked-in version will be available, as the workflow version belongs to another user. I think it's possible to use the mediator without doing this, but there will be functional trade-offs. Check the mediator documentation for the relevant settings.

1
  • We have seen this in the past with major versions and have done the things you have outlined with success. However, how can the system be told to get the minor workflow version? It seems to only know about the major versions. Commented May 15, 2017 at 21:18

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.