如何将请求参数传递给“persistence-model.xml”中的“fr-workflow-send-submission”?例如,如果我打开一个表单:
.../orbeon..?myRequestParameter=myRequestParameterValue
然后将 myRequestParameter 传递给“oxf.fr.detail.send.success.uri ... ”
我尝试执行以下操作:
<xforms:model id="fr-persistence-model"....
....
<xxforms:variable name="parameters" value="xxforms:instance('fr-parameters- instance')" as="element()"/>
<xxforms:variable name="app" value="$parameters/app" as="xs:string"/>
<xxforms:variable name="form" value="$parameters/form" as="xs:string"/>
<xxforms:variable name="document" select="$parameters/document"/>
<xxforms:variable name="mode" select="$parameters/mode"/>
....
<xxforms:variable name="myVariable"/>
....
<xforms:action ev:event="xforms-model-construct-done" if="$app != '*' and $form != '*'">
....
<xforms:setvalue ref="$myVariable" value="xxforms:get-request-parameter('myRequestParameter')">
....
<xforms:submission id="fr-workflow-send-submission"
resource="{$workflow-success-uri}?myRequestParameter={$myVariable}"
relevant="{xxforms:property(string-join(('oxf.fr.detail.send.success.prune', $app, $form), '.'))}"
validate="false" method="{$workflow-success-method}"
serialization="{if ($workflow-success-method = 'get') then 'none' else 'application/xml'}"
ref="if (instance('fr-workflow-send-instance') != '') then instance('fr-workflow-send-instance') else xxforms:instance('fr-form-instance')"
replace="all"/>
....
并且变量“myVariable”始终为空。
我还尝试对“xforms-model-construct-done”事件进行插入:
....
<xxforms:variable name="parameters" value="xxforms:instance('fr-parameters- instance')" as="element()"/>
<xxforms:variable name="myVariable" select="$parameters/myRequestParameter"/>
....
//on xforms-model-construct-done
<xforms:action>
<xxforms:variable name="myRequestParameter-name" select="'myRequestParameter'"/>
<xxforms:variable name="myRequestParameter-value" select="xxforms:get-request-parameter($myRequestParameter-name)"/>
<xforms:insert context="instance('fr-parameters- instance')" origin="xxforms:element($myRequestParameter-name, $myRequestParameter-value)"/>
</xforms:action>
....
但“myVariable”仍然是空的。