我只是想知道我们是否可以存储来自SQL查找规则的结果值,并在脚本下的组件定义中使用它。
示例代码:
<action-definition>
<component-name>SQLLookupRule</component-name>
<action-type>Relational</action-type>
<action-outputs>
<query-result type="result-set" mapping="timestamp_fibu_export"/>
</action-outputs>
<component-definition>
<jndi><![CDATA[Poly_MIS_ETL_LAST_TIMESTAMP]]></jndi>
<query><![CDATA[select extract( month from prev_timestamp_fibu_export)::int as prev_timestamp_fibu_export from system_settings]]></query>
<live><![CDATA[true]]></live>
</component-definition>
</action-definition>
<action-definition>
<component-name>JavascriptRule</component-name>
<action-type>Do process a report for previous month?</action-type>
<action-outputs>
<process_report_also_for_previous_month type="integer"/>
</action-outputs>
<component-definition>
<!--<script><![CDATA[// returns "true" if a current day is the first Monday in a month
var d = new Date();
((d.getDay() == 1) && ((d.getDate() == 2) || (d.getDate() == 3)))]]></script> -->
<script><![CDATA[// returns "true" if a current day is the first Monday in a month
var d = new Date();
((d.getDay() == 1) || (d.getMonth()+1 - timestamp_fibu_export == 1)]]></script>
</component-definition>
</action-definition>
是,有可能。