Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions core/src/main/java/org/apache/hop/core/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public String toString() {
* @return a List of rows associated with the result of execution of a workflow or pipeline
*/
public List<RowMetaAndData> getRows() {
return new ArrayList<>(rows);
return rows;
}

/**
Expand All @@ -254,10 +254,14 @@ public List<RowMetaAndData> getRows() {
* @param rows The List of rows to set.
*/
public void setRows(List<RowMetaAndData> rows) {
if (rows == null) {
this.rows = new ArrayList<>();
if (rows != null) {
this.rows = rows;
} else {
this.rows = new ArrayList<>(rows);
// When setting to null (this happens for example every time a parallel
// branches in workflow starts), we empty rows' list because in
// this case it is needed a Result without any row to start the execution
// from a clean rows' state
this.rows = new ArrayList<>();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->
<pipeline>
<info>
<name>0036-actionpipeline-getresults-fromparams</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<pipeline_status>0</pipeline_status>
<parameters>
<parameter>
<name>p1</name>
<default_value/>
<description/>
</parameter>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2021/10/27 22:28:27.766</created_date>
<modified_user>-</modified_user>
<modified_date>2021/10/27 22:28:27.766</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Get variables</from>
<to>If Null</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>If Null</from>
<to>Check if there's a value</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Check if there's a value</from>
<to>Abort 1</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Check if there's a value</from>
<to>Check field value</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Check field value</from>
<to>Success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Check field value</from>
<to>Abort 2</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Abort 1</name>
<type>Abort</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<abort_option>ABORT_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<message>ERROR: The parameter containng the column's value is empty</message>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>480</xloc>
<yloc>240</yloc>
</GUI>
</transform>
<transform>
<name>Abort 2</name>
<type>Abort</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<abort_option>ABORT_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<message>ERROR: The parameter value is not correct</message>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>240</yloc>
</GUI>
</transform>
<transform>
<name>Check field value</name>
<type>FilterRows</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<compare>
<condition>
<conditions>
</conditions>
<function>IN LIST</function>
<leftvalue>f1</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<mask/>
<name>constant</name>
<precision>-1</precision>
<text>a;b</text>
<type>String</type>
</value>
</condition>
</compare>
<send_false_to>Abort 2</send_false_to>
<send_true_to>Success</send_true_to>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>Check if there's a value</name>
<type>FilterRows</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<compare>
<condition>
<conditions>
</conditions>
<function>&lt;></function>
<leftvalue>f1</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>Empty</text>
<type>String</type>
</value>
</condition>
</compare>
<send_false_to>Abort 1</send_false_to>
<send_true_to>Check field value</send_true_to>
<attributes/>
<GUI>
<xloc>480</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>Get variables</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>f1</name>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
<variable>${p1}</variable>
</field>
</fields>
<attributes/>
<GUI>
<xloc>224</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>If Null</name>
<type>IfNull</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>f1</name>
<set_empty_string>N</set_empty_string>
<value>Empty</value>
</field>
</fields>
<selectFields>Y</selectFields>
<selectValuesType>N</selectValuesType>
<setEmptyStringAll>N</setEmptyStringAll>
<valuetypes>
</valuetypes>
<attributes/>
<GUI>
<xloc>352</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform>
<name>Success</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>784</xloc>
<yloc>112</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>
Loading
Loading