我们能否使用SQL查询中的值并将其用作对角动作序列或xactions中的javascript变量

问题描述 投票:0回答:1

我只是想知道我们是否可以存储来自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>
action sequence pentaho
1个回答
0
投票

是,有可能。

© www.soinside.com 2019 - 2024. All rights reserved.