[英]BPEL variables initialisation
是否可以在声明中初始化BPEL变量? 如果可以的话如何?
声明示例:
<variables>
<variable name="offer" type="xsd:float"/>
<variable name="response" type="xsd:string"/>
</variables>
这个有可能。 BPEL 2.0允许直接在变量声明中使用from-spec。 但是,并非所有BPEL引擎都实现此功能,例如Apache ODE无法处理此类内联初始化。
以下代码段是有效的BPEL 2.0:
<variables>
<variable name="response" type="xsd:string">
<from>'TocToc'</from>
</variable>
<variable name="offer" type="xsd:float">
<from>100</from>
</variable>
</variables>
有关示例,请参见[1]的第121页和[1]的8.1(第45页)部分。
我们使用Oracle BPEL,它允许在bpel.xml文件中设置属性,如下所示:
<preferences>
<property name="output_file" encryption="plaintext">logging.txt</property>
<property name="expire_hours" encryption="plaintext">10</property>
<property name="retry_count" encryption="plaintext">4</property>
</preferences>
可以使用ora:getPreference(“ varname”)在代码中进行访问
这些也显示在BPEL控制台上,如有必要,可以由管理员更改。
经过一番谷歌搜索,阅读规范和示例...我认为不可能在声明中初始化BPEL变量...如果我们希望我们需要按以下流程进行操作:
...
<variables>
<variable name="response" type="xsd:string"/>
<variable name="offer" type="xsd:float"/>
</variables>
...
<sequence>
<receive createInstance="yes" .../>
...
<assign name="init">
<copy>
<from>100</from>
<to variable="offer"/>
</copy>
<copy>
<from>'TocToc'</from>
<to variable="response"/>
</copy>
</assign>
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.