Question
· Apr 15, 2016

How to include dynaform in a custom task form in an Ensemble workflow?

Hi,

I'm trying to create an Ensemble workflow with a custom task form that includes a dynaform zen component.
Is it possible to do that? Any sample code?

Thanks for your help

Blaise

Discussion (1)0
Log in or sign up to continue

In short: you could put a Zen page with a dynaForm in an <iframe>, or use something other than Zen/dynaForm.

The documentation about custom workflow task forms says that the form should be a fragment of HTML in a CSP page, not an entire page. Although Zen pages are CSP pages, it looks like Zen pages can't be used directly as the form template. Under the hood, the inclusion of this CSP page bypasses %OnPreHTTP, which does some necessary setup for Zen pages (particularly, initializing %page and %application). Even if this wasn't the case, and a full Zen page could be inserted, it would end up looking pretty weird.

A fairly simple solution would be create a very simple CSP page that has an <iframe> containing your Zen page, and to use that CSP page as the form template. Any necessary data from %task could be passed along in the Zen page's URL. The onAction method could also be propagated to the iframe, perhaps using Window.postMessage (etc.) to define how the frames can interact.

If that's getting too complicated, perhaps consider using something other than Zen/dynaForm that would fit more naturally in a CSP page. (Perhaps modern JS libraries, REST, etc.)