Fix migration of sequences

This commit is contained in:
Sergi Almacellas Abellana 2014-09-25 16:30:42 +02:00
parent 836b57e5dd
commit 96ebeb9a27
3 changed files with 288 additions and 407 deletions

View File

@ -67,27 +67,6 @@
<modified_date>2012&#47;12&#47;02 09:29:11.116</modified_date>
</info>
<notepads>
<notepad>
<note> Account Journal (account.journal) is ID = 6</note>
<xloc>324</xloc>
<yloc>284</yloc>
<width>263</width>
<heigth>26</heigth>
<fontname>Arial</fontname>
<fontsize>10</fontsize>
<fontbold>N</fontbold>
<fontitalic>N</fontitalic>
<fontcolorred>0</fontcolorred>
<fontcolorgreen>0</fontcolorgreen>
<fontcolorblue>0</fontcolorblue>
<backgroundcolorred>255</backgroundcolorred>
<backgroundcolorgreen>165</backgroundcolorgreen>
<backgroundcolorblue>0</backgroundcolorblue>
<bordercolorred>100</bordercolorred>
<bordercolorgreen>100</bordercolorgreen>
<bordercolorblue>100</bordercolorblue>
<drawshadow>Y</drawshadow>
</notepad>
</notepads>
<connection>
<name>source</name>
@ -134,7 +113,7 @@
</attributes>
</connection>
<order>
<hop> <from>Table input</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>create_uid</from><to>write_uid</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>target</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>write_uid</from><to>state</to><enabled>Y</enabled> </hop> <hop> <from>state</from><to>Add constants</to><enabled>Y</enabled> </hop> <hop> <from>union</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>Add constants</from><to>union 2</to><enabled>Y</enabled> </hop> <hop> <from>union 2</from><to>target_sequence</to><enabled>Y</enabled> </hop> <hop> <from>Sequence code</from><to>Join</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>Join</to><enabled>Y</enabled> </hop> <hop> <from>Join</from><to>create_uid</to><enabled>Y</enabled> </hop> <hop> <from>target_sequence</from><to>Filter rows</to><enabled>Y</enabled> </hop> <hop> <from>Filter rows</from><to>union</to><enabled>Y</enabled> </hop> </order>
<hop> <from>Table input</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>create_uid</from><to>write_uid</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>target</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>write_uid</from><to>state</to><enabled>Y</enabled> </hop> <hop> <from>state</from><to>Add constants</to><enabled>Y</enabled> </hop> <hop> <from>union</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>Modified Java Script Value 2</from><to>Execute SQL script 2</to><enabled>Y</enabled> </hop> <hop> <from>sequence</from><to>Modified Java Script Value 2</to><enabled>Y</enabled> </hop> <hop> <from>Add constants</from><to>sequence</to><enabled>Y</enabled> </hop> <hop> <from>sequence</from><to>union</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>create_uid</to><enabled>Y</enabled> </hop> </order>
<step>
<name>Add constants</name>
<type>Constant</type>
@ -168,18 +147,106 @@
<length>0</length>
<precision>0</precision>
</field>
<field>
<name>timestamp_rounding</name>
<type>integer</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>1</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>timestamp_offset</name>
<type>integer</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>946681200</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>type</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>incremental</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>number_increment</name>
<type>Integer</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>1</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>number_next_internal</name>
<type>Integer</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>1</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>padding</name>
<type>Integer</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>0</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>moves_code</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>account.move</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
<field>
<name>sequence_active</name>
<type>Boolean</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>Y</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>448</xloc>
<xloc>378</xloc>
<yloc>206</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Filter rows</name>
<type>FilterRows</type>
<name>Execute SQL script 2</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
@ -187,27 +254,31 @@
<method>none</method>
<schema_name/>
</partitioning>
<send_true_to/>
<send_false_to/>
<compare>
<condition>
<negated>N</negated>
<leftvalue>target_sequence_id</leftvalue>
<function>IS NOT NULL</function>
<rightvalue/>
</condition>
</compare>
<connection>target</connection>
<execute_each_row>Y</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>N</replace_variables>
<sql>CREATE SEQUENCE ? INCREMENT BY ? START WITH ?</sql>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
<argument><name>sequence_name</name></argument>
<argument><name>number_increment</name></argument>
<argument><name>number_next_internal</name></argument>
</arguments>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>730</xloc>
<yloc>207</yloc>
<xloc>680</xloc>
<yloc>102</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Join</name>
<type>JoinRows</type>
<name>Modified Java Script Value 2</name>
<type>ScriptValueMod</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
@ -215,22 +286,23 @@
<method>none</method>
<schema_name/>
</partitioning>
<directory>%%java.io.tmpdir%%</directory>
<prefix>out</prefix>
<cache_size>500</cache_size>
<main>Sequence code</main>
<compare>
<condition>
<negated>N</negated>
<leftvalue>source_sequence_id</leftvalue>
<function>=</function>
<rightvalue>source_sequence_id</rightvalue>
</condition>
</compare>
<cluster_schema/>
<compatible>N</compatible>
<optimizationLevel>9</optimizationLevel>
<jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
<jsScript_name>Script 1</jsScript_name>
<jsScript_script>&#47;&#47;Script here
sequence_name = &quot;ir_sequence_&quot; + post_move_sequence;</jsScript_script>
</jsScript> </jsScripts> <fields> <field> <name>sequence_name</name>
<rename>sequence_name</rename>
<type>String</type>
<length>-1</length>
<precision>-1</precision>
<replace>N</replace>
</field> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>134</xloc>
<yloc>208</yloc>
<xloc>485</xloc>
<yloc>97</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -249,7 +321,14 @@
<remove> <name>create_uid</name>
</remove> <remove> <name>write_uid</name>
</remove> <remove> <name>state</name>
</remove> <remove> <name>source_sequence_id</name>
</remove> <remove> <name>moves_code</name>
</remove> <remove> <name>number_increment</name>
</remove> <remove> <name>number_next_internal</name>
</remove> <remove> <name>type</name>
</remove> <remove> <name>timestamp_rounding</name>
</remove> <remove> <name>timestamp_offset</name>
</remove> <remove> <name>padding</name>
</remove> <remove> <name>sequence_active</name>
</remove> <meta> <name>create_uid_target</name>
<rename>create_uid</rename>
<type>Integer</type>
@ -310,51 +389,14 @@
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta> <meta> <name>target_sequence_id</name>
<rename>post_move_sequence</rename>
<type>Integer</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>893</xloc>
<xloc>652</xloc>
<yloc>207</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Sequence code</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>source</connection>
<sql>SELECT id as source_sequence_id FROM ir_sequence WHERE code = &apos;account.journal&apos; and name like &apos;%Account%&apos;</sql>
<limit>1</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>N</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>141</xloc>
<yloc>104</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Table input</name>
<type>TableInput</type>
@ -411,7 +453,7 @@
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>1052</xloc>
<xloc>810</xloc>
<yloc>299</yloc>
<draw>Y</draw>
</GUI>
@ -452,12 +494,85 @@
</lookup>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>205</xloc>
<xloc>135</xloc>
<yloc>206</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>sequence</name>
<type>TableOutput</type>
<description/>
<distribute>N</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target</connection>
<schema/>
<table>ir_sequence</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>N</use_batch>
<specify_fields>Y</specify_fields>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_daily>N</partitioning_daily>
<partitioning_monthly>Y</partitioning_monthly>
<tablename_in_field>N</tablename_in_field>
<tablename_field/>
<tablename_in_table>N</tablename_in_table>
<return_keys>Y</return_keys>
<return_field>post_move_sequence</return_field>
<fields>
<field>
<column_name>timestamp_rounding</column_name>
<stream_name>timestamp_rounding</stream_name>
</field>
<field>
<column_name>timestamp_offset</column_name>
<stream_name>timestamp_offset</stream_name>
</field>
<field>
<column_name>type</column_name>
<stream_name>type</stream_name>
</field>
<field>
<column_name>number_increment</column_name>
<stream_name>number_increment</stream_name>
</field>
<field>
<column_name>number_next_internal</column_name>
<stream_name>number_next_internal</stream_name>
</field>
<field>
<column_name>name</column_name>
<stream_name>name</stream_name>
</field>
<field>
<column_name>code</column_name>
<stream_name>moves_code</stream_name>
</field>
<field>
<column_name>padding</column_name>
<stream_name>padding</stream_name>
</field>
<field>
<column_name>active</column_name>
<stream_name>sequence_active</stream_name>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>485</xloc>
<yloc>205</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>source</name>
<type>Dummy</type>
@ -503,7 +618,7 @@ if(state == &quot;draft&quot;)
<replace>N</replace>
</field> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>360</xloc>
<xloc>290</xloc>
<yloc>206</yloc>
<draw>Y</draw>
</GUI>
@ -521,53 +636,12 @@ if(state == &quot;draft&quot;)
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>1048</xloc>
<xloc>806</xloc>
<yloc>212</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>target_sequence</name>
<type>DBLookup</type>
<description/>
<distribute>Y</distribute>
<copies>4</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target</connection>
<cache>Y</cache>
<cache_load_all>Y</cache_load_all>
<cache_size>0</cache_size>
<lookup>
<schema>migration</schema>
<table>ir_sequence_mapping</table>
<orderby/>
<fail_on_multiple>N</fail_on_multiple>
<eat_row_on_failure>N</eat_row_on_failure>
<key>
<name>source_sequence_id</name>
<field>source</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>target</name>
<rename>target_sequence_id</rename>
<default/>
<type>Integer</type>
</value>
</lookup>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>638</xloc>
<yloc>206</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>union</name>
<type>Dummy</type>
@ -580,30 +654,12 @@ if(state == &quot;draft&quot;)
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>820</xloc>
<xloc>578</xloc>
<yloc>206</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>union 2</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>558</xloc>
<yloc>207</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>write_uid</name>
<type>DBLookup</type>
@ -639,7 +695,7 @@ if(state == &quot;draft&quot;)
</lookup>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>288</xloc>
<xloc>218</xloc>
<yloc>205</yloc>
<draw>Y</draw>
</GUI>

View File

@ -67,27 +67,6 @@
<modified_date>2012&#47;12&#47;02 09:29:11.116</modified_date>
</info>
<notepads>
<notepad>
<note> Account Journal (account.journal) is ID = 6</note>
<xloc>147</xloc>
<yloc>353</yloc>
<width>262</width>
<heigth>26</heigth>
<fontname>Arial</fontname>
<fontsize>10</fontsize>
<fontbold>N</fontbold>
<fontitalic>N</fontitalic>
<fontcolorred>0</fontcolorred>
<fontcolorgreen>0</fontcolorgreen>
<fontcolorblue>0</fontcolorblue>
<backgroundcolorred>255</backgroundcolorred>
<backgroundcolorgreen>165</backgroundcolorgreen>
<backgroundcolorblue>0</backgroundcolorblue>
<bordercolorred>100</bordercolorred>
<bordercolorgreen>100</bordercolorgreen>
<bordercolorblue>100</bordercolorblue>
<drawshadow>Y</drawshadow>
</notepad>
</notepads>
<connection>
<name>source</name>
@ -95,9 +74,9 @@
<type>POSTGRESQL</type>
<access>Native</access>
<database>${source}</database>
<port>5432</port>
<port>${source_port}</port>
<username>${source_user}</username>
<password>Encrypted </password>
<password>${source_password}</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
@ -105,7 +84,7 @@
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>5432</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>${source_port}</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
@ -117,9 +96,9 @@
<type>POSTGRESQL</type>
<access>Native</access>
<database>${target}</database>
<port>5432</port>
<port>${target_port}</port>
<username>${target_user}</username>
<password>Encrypted </password>
<password>${target_password}</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
@ -127,14 +106,14 @@
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>5432</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>${target_port}</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>
</connection>
<order>
<hop> <from>Table input</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>create_uid</from><to>write_uid</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>create_uid</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>target</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>write_uid</from><to>state</to><enabled>Y</enabled> </hop> <hop> <from>union</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>state</from><to>type</to><enabled>Y</enabled> </hop> <hop> <from>type</from><to>Add constants</to><enabled>Y</enabled> </hop> <hop> <from>Add constants</from><to>union 2</to><enabled>Y</enabled> </hop> <hop> <from>target_sequence</from><to>union</to><enabled>Y</enabled> </hop> <hop> <from>union 2</from><to>Value Mapper</to><enabled>Y</enabled> </hop> <hop> <from>Value Mapper</from><to>target_sequence</to><enabled>Y</enabled> </hop> </order>
<hop> <from>Table input</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>create_uid</from><to>write_uid</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>create_uid</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>target</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>Table output</to><enabled>N</enabled> </hop> <hop> <from>write_uid</from><to>state</to><enabled>Y</enabled> </hop> <hop> <from>union</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>state</from><to>type</to><enabled>Y</enabled> </hop> <hop> <from>type</from><to>Add constants</to><enabled>Y</enabled> </hop> <hop> <from>Add constants</from><to>union 2</to><enabled>Y</enabled> </hop> <hop> <from>union 2</from><to>Value Mapper</to><enabled>Y</enabled> </hop> <hop> <from>Value Mapper</from><to>union</to><enabled>Y</enabled> </hop> </order>
<step>
<name>Add constants</name>
<type>Constant</type>
@ -275,22 +254,10 @@
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta> <meta> <name>target_sequence_id</name>
<rename>post_move_sequence</rename>
<type>Integer</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>937</xloc>
<yloc>181</yloc>
<xloc>841</xloc>
<yloc>177</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -351,8 +318,39 @@
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>1096</xloc>
<yloc>273</yloc>
<xloc>1000</xloc>
<yloc>269</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Value Mapper</name>
<type>ValueMapper</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<field_to_use>state</field_to_use>
<target_field/>
<non_match_default/>
<fields>
<field>
<source_value>draft</source_value>
<target_value>open</target_value>
</field>
<field>
<source_value>done</source_value>
<target_value>closed</target_value>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>672</xloc>
<yloc>178</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -461,49 +459,8 @@ if(state == &quot;draft&quot;)
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>1095</xloc>
<yloc>181</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>target_sequence</name>
<type>DBLookup</type>
<description/>
<distribute>Y</distribute>
<copies>4</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target</connection>
<cache>Y</cache>
<cache_load_all>Y</cache_load_all>
<cache_size>0</cache_size>
<lookup>
<schema>migration</schema>
<table>ir_sequence_mapping</table>
<orderby/>
<fail_on_multiple>N</fail_on_multiple>
<eat_row_on_failure>N</eat_row_on_failure>
<key>
<name>source_sequence_id</name>
<field>source</field>
<condition>=</condition>
<name2/>
</key>
<value>
<name>target</name>
<rename>target_sequence_id</rename>
<default/>
<type>Integer</type>
</value>
</lookup>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>737</xloc>
<yloc>180</yloc>
<xloc>999</xloc>
<yloc>177</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -553,8 +510,8 @@ if(special == true)
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>855</xloc>
<yloc>180</yloc>
<xloc>759</xloc>
<yloc>176</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -571,7 +528,7 @@ if(special == true)
</partitioning>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>614</xloc>
<xloc>597</xloc>
<yloc>181</yloc>
<draw>Y</draw>
</GUI>
@ -618,37 +575,6 @@ if(special == true)
</GUI>
</step>
<step>
<name>Value Mapper</name>
<type>ValueMapper</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<field_to_use>state</field_to_use>
<target_field/>
<non_match_default/>
<fields>
<field>
<source_value>draft</source_value>
<target_value>open</target_value>
</field>
<field>
<source_value>done</source_value>
<target_value>closed</target_value>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>672</xloc>
<yloc>178</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>

View File

@ -113,7 +113,7 @@
</attributes>
</connection>
<order>
<hop> <from>Table input 2</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output 2</to><enabled>N</enabled> </hop> <hop> <from>Add constants</from><to>sequence_strict</to><enabled>Y</enabled> </hop> <hop> <from>Modified Java Script Value</from><to>Execute SQL script</to><enabled>Y</enabled> </hop> <hop> <from>sequence 2</from><to>Modified Java Script Value</to><enabled>Y</enabled> </hop> <hop> <from>sequence 2</from><to>prep 2</to><enabled>Y</enabled> </hop> <hop> <from>sequence_strict</from><to>sequence 2</to><enabled>Y</enabled> </hop> <hop> <from>prep 2</from><to>target</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>Add constants</to><enabled>Y</enabled> </hop> </order>
<hop> <from>Table input 2</from><to>source</to><enabled>N</enabled> </hop> <hop> <from>target</from><to>Table output 2</to><enabled>N</enabled> </hop> <hop> <from>Add constants</from><to>sequence_strict</to><enabled>Y</enabled> </hop> <hop> <from>source</from><to>Add constants</to><enabled>Y</enabled> </hop> <hop> <from>sequence_strict</from><to>prep 2</to><enabled>Y</enabled> </hop> <hop> <from>prep 2</from><to>Select values</to><enabled>Y</enabled> </hop> <hop> <from>Select values</from><to>target</to><enabled>Y</enabled> </hop> </order>
<step>
<name>Add constants</name>
<type>Constant</type>
@ -203,13 +203,13 @@
<precision>-1</precision>
</field>
<field>
<name>moves_code</name>
<type>String</type>
<name>sequence_active</name>
<type>Boolean</type>
<format/>
<currency/>
<decimal/>
<group/>
<nullif>account.move</nullif>
<nullif>Y</nullif>
<length>-1</length>
<precision>-1</precision>
</field>
@ -223,64 +223,28 @@
</step>
<step>
<name>Execute SQL script</name>
<type>ExecSQL</type>
<name>Select values</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<distribute>N</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target</connection>
<execute_each_row>Y</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>N</replace_variables>
<sql>CREATE SEQUENCE ? INCREMENT BY ? START WITH ?</sql>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
<argument><name>sequence_name</name></argument>
<argument><name>number_increment</name></argument>
<argument><name>number_next_internal</name></argument>
</arguments>
<cluster_schema/>
<fields> <select_unspecified>N</select_unspecified>
<remove> <name>invoice_code</name>
</remove> <remove> <name>number_increment</name>
</remove> <remove> <name>number_next_internal</name>
</remove> <remove> <name>type</name>
</remove> <remove> <name>timestamp_rounding</name>
</remove> <remove> <name>timestamp_offset</name>
</remove> <remove> <name>padding</name>
</remove> <remove> <name>sequence_active</name>
</remove> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>571</xloc>
<yloc>216</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Modified Java Script Value</name>
<type>ScriptValueMod</type>
<description/>
<distribute>Y</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<compatible>N</compatible>
<optimizationLevel>9</optimizationLevel>
<jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
<jsScript_name>Script 1</jsScript_name>
<jsScript_script>&#47;&#47;Script here
sequence_name = &quot;ir_sequence_&quot; + move_sequence;</jsScript_script>
</jsScript> </jsScripts> <fields> <field> <name>sequence_name</name>
<rename>sequence_name</rename>
<type>String</type>
<length>-1</length>
<precision>-1</precision>
<replace>N</replace>
</field> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>425</xloc>
<yloc>220</yloc>
<xloc>584</xloc>
<yloc>84</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -393,77 +357,8 @@ var out_credit_note_sequence = invoice_sequence;</jsScript_script>
<replace>N</replace>
</field> </fields> <cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>532</xloc>
<yloc>81</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>sequence 2</name>
<type>TableOutput</type>
<description/>
<distribute>N</distribute>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target</connection>
<schema/>
<table>ir_sequence</table>
<commit>1000</commit>
<truncate>N</truncate>
<ignore_errors>N</ignore_errors>
<use_batch>N</use_batch>
<specify_fields>Y</specify_fields>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_daily>N</partitioning_daily>
<partitioning_monthly>Y</partitioning_monthly>
<tablename_in_field>N</tablename_in_field>
<tablename_field/>
<tablename_in_table>N</tablename_in_table>
<return_keys>Y</return_keys>
<return_field>move_sequence</return_field>
<fields>
<field>
<column_name>timestamp_rounding</column_name>
<stream_name>timestamp_rounding</stream_name>
</field>
<field>
<column_name>timestamp_offset</column_name>
<stream_name>timestamp_offset</stream_name>
</field>
<field>
<column_name>type</column_name>
<stream_name>type</stream_name>
</field>
<field>
<column_name>number_increment</column_name>
<stream_name>number_increment</stream_name>
</field>
<field>
<column_name>number_next_internal</column_name>
<stream_name>number_next_internal</stream_name>
</field>
<field>
<column_name>name</column_name>
<stream_name>name</stream_name>
</field>
<field>
<column_name>code</column_name>
<stream_name>moves_code</stream_name>
</field>
<field>
<column_name>padding</column_name>
<stream_name>padding</stream_name>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>430</xloc>
<yloc>81</yloc>
<xloc>494</xloc>
<yloc>82</yloc>
<draw>Y</draw>
</GUI>
</step>
@ -528,11 +423,15 @@ var out_credit_note_sequence = invoice_sequence;</jsScript_script>
<column_name>code</column_name>
<stream_name>invoice_code</stream_name>
</field>
<field>
<column_name>active</column_name>
<stream_name>sequence_active</stream_name>
</field>
</fields>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>333</xloc>
<yloc>81</yloc>
<xloc>364</xloc>
<yloc>79</yloc>
<draw>Y</draw>
</GUI>
</step>