如何在 WSO2 BPEL 中分配当前日期?
How to assign current-date in WSO2 BPEL?
我没有找到如何在 WSO2 BPEL 中分配当前日期的方法。
我试过这个:
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[$ode:currentEventDateTime]]>
</bpel:from>
它引发错误:
[UndeclaredVariable] Attempt to reference undeclared variable "currentEventDateTime" while deploying
fn:current-dateTime or current-dateTime()
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[fn:current-dateTime]]>
</bpel:from>
Fault Name {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure
Fault Message {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression fn:current-dateTime}" did not select any nodes.
Fault Data No data available.
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[fn:current-dateTime()]]>
</bpel:from>
加注:
ERROR {org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor} - BPEL Process Compilation Failure.
org.apache.ode.utils.NSContext$NSContextException: Namespace not found for prefix "fn" while deploying.
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[current-dateTime()]]>
</bpel:from>
Fault Name {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure
Fault Message {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: An exception occured while evaluating "{OXPath10Expression current-dateTime()}": No Such Function current-dateTime
Fault Data No data available.
我找到了使用 xsl 转换的解决方案
BPEL:
<bpel:copy>
<bpel:from>bpel:doXslTransform("datetime.xsl", $variable.part)</bpel:from>
<bpel:to part="parameters" variable="var"></bpel:to>
</bpel:copy>
XSL:
<xsl:stylesheet version="1.0">
<xsl:template match="/">
<!--variable structure-->
<cmism:deliveryDate><xsl:value-of select="current-dateTime()"/>
</cmism:deliveryDate>
</xsl:template>
</xsl:stylesheet>
我没有找到如何在 WSO2 BPEL 中分配当前日期的方法。 我试过这个:
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[$ode:currentEventDateTime]]>
</bpel:from>
它引发错误:
[UndeclaredVariable] Attempt to reference undeclared variable "currentEventDateTime" while deploying
fn:current-dateTime or current-dateTime()
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[fn:current-dateTime]]>
</bpel:from>
Fault Name {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure
Fault Message {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression fn:current-dateTime}" did not select any nodes.
Fault Data No data available.
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[fn:current-dateTime()]]>
</bpel:from>
加注:
ERROR {org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor} - BPEL Process Compilation Failure.
org.apache.ode.utils.NSContext$NSContextException: Namespace not found for prefix "fn" while deploying.
<bpel:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[current-dateTime()]]>
</bpel:from>
Fault Name {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure
Fault Message {http: //docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: An exception occured while evaluating "{OXPath10Expression current-dateTime()}": No Such Function current-dateTime
Fault Data No data available.
我找到了使用 xsl 转换的解决方案
BPEL:
<bpel:copy>
<bpel:from>bpel:doXslTransform("datetime.xsl", $variable.part)</bpel:from>
<bpel:to part="parameters" variable="var"></bpel:to>
</bpel:copy>
XSL:
<xsl:stylesheet version="1.0">
<xsl:template match="/">
<!--variable structure-->
<cmism:deliveryDate><xsl:value-of select="current-dateTime()"/>
</cmism:deliveryDate>
</xsl:template>
</xsl:stylesheet>