livebos--退回自定义1

 <variables>
    <variable describe="V_1(获取旧当前步骤id)" messageType="" name="V_1" type="int" />
    <variable describe="V_2(新的步骤)" messageType="" name="V_2" type="int" />
    <variable describe="V_3(历史步骤表最大id)" messageType="" name="V_3" type="int" />
    <variable describe="V_4(历史步骤表最大日期)" messageType="" name="V_4" type="date" />
  </variables>
  <sequence id="0" name="顺序">
    <assign id="0">
      <describe>赋值</describe>
      <copy>
        <from type="expression">&lt;%@ livebos language='javascript' %&gt;
ABS_SQLVALUE("select id from OS_CURRENTSTEP where entry_id=?",[O_MASTER.InstID])</from>
        <to variable="V_1" />
      </copy>
      <copy>
        <from type="expression">&lt;%@ livebos language='javascript' %&gt;
var unit=ABS_LOADBEAN("com.plug.UtilHelper");&#xD;
var id=unit.getNextID("OS_CURRENTSTEP");&#xD;
id;</from>
        <to variable="V_2" />
      </copy>
    </assign>
    <assign id="0">
      <describe>赋值</describe>
      <copy>
        <from type="expression">&lt;%@ livebos language='javascript' %&gt;
ABS_SQLVALUE("select max(id) from OS_HISTORYSTEP  where entry_id=? ",[O_MASTER.InstID])</from>
        <to variable="V_3" />
      </copy>
      <copy>
        <from type="expression">&lt;%@ livebos language='javascript' %&gt;&#xD;
ABS_SQLVALUE("select max(start_date) from OS_HISTORYSTEP  where entry_id=? ",[O_MASTER.InstID])</from>
        <to variable="V_4" />
      </copy>
    </assign>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>插入历史步骤表</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["insert into os_historystep(id,entry_id,step_id,action_id,owner,finish_date,status,caller,summary,flag,start_date)\r\nvalues({3},{0},13,-10002,{1},sysdate,'已退回',{1},{2},0,{4})",[{"expression":"O_MASTER.InstID","scale":"","length":"","type":"1"},{"expression":"$Login.User","scale":"","length":"","type":"1"},{"expression":"O_PARAMETER.PReason","scale":"","length":"","type":"0"},{"expression":"V_1","scale":"","length":"","type":"1"},{"expression":"V_4","scale":"","length":"","type":"3"}]]</arg>
    </invoke>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>插入步骤历史步骤关联表</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["insert into OS_HISTORYSTEP_PREV(id,previous_id)\r\nvalues({0},{1})",[{"expression":"V_1","scale":"","length":"","type":"1"},{"expression":"V_3","scale":"","length":"","type":"1"}]]</arg>
    </invoke>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>删除当前步骤关联表</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["delete from OS_CURRENTSTEP_PREV where id={0}",[{"expression":"V_1","scale":"","length":"","type":"1"}]]</arg>
    </invoke>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>更新当前步骤</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["update OS_CURRENTSTEP w1  set w1.id={0},w1.step_id=3,w1.owner={1},w1.status='退回',w1.summary={2},w1.start_date=sysdate where w1.entry_id= {3}",[{"expression":"V_2","scale":"","length":"","type":"1"},{"expression":"$Login.User","scale":"","length":"","type":"1"},{"expression":"O_PARAMETER.PReason","scale":"","length":"","type":"0"},{"expression":"O_MASTER.InstID","scale":"","length":"","type":"1"}]]</arg>
    </invoke>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>插入当前步骤关联</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["insert into OS_CURRENTSTEP_PREV(id,previous_id)values({0},{1})",[{"expression":"V_2","scale":"","length":"","type":"1"},{"expression":"V_1","scale":"","length":"","type":"1"}]]</arg>
    </invoke>
    <invoke component="SQL" id="0" name="数据库组件_执行SQL语句" operation="execute">
      <describe>更新当前参与人</describe>
      <arg name="TranType">sql</arg>
      <arg name="SQL">["update Lbwfcurrentowner set stepid={0},owner={1} where stepid={2}",[{"expression":"V_2","scale":"","length":"","type":"1"},{"expression":"$Login.User","scale":"","length":"","type":"1"},{"expression":"V_1","scale":"","length":"","type":"1"}]]</arg>
    </invoke>
    <invoke component="expression" id="0" name="执行脚本">
      <describe>刷新工作流</describe>
      <arg name="expression">ABS_flushObjCache("WF_FM_UtilityCosts");&#xD;
ABS_flushObjCache("OS_HISTORYSTEP_PREV");&#xD;
ABS_flushObjCache("OS_HISTORYSTEP");&#xD;
ABS_flushObjCache("OS_CURRENTSTEP");&#xD;
ABS_flushObjCache("OS_CURRENTSTEP_PREV");&#xD;
ABS_flushObjCache("Lbwfcurrentowner");&#xD;
ABS_flushObjCache("F_FM_UtilityCosts");</arg>
    </invoke>
  </sequence>
</process>

posted on 2018-01-24 14:56  luhanzhen  阅读(199)  评论(0编辑  收藏  举报