This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 1782d32d89 Add basic file action examples to samples (#5976)
1782d32d89 is described below
commit 1782d32d8945919068d7c853531b999b7601a7c0
Author: Drazen Sander <[email protected]>
AuthorDate: Mon Nov 10 16:54:55 2025 +0100
Add basic file action examples to samples (#5976)
---
.../src/main/samples/actions/copy-files.hwf | 114 ++++++++++++++
.../src/main/samples/actions/create-file.hwf | 102 +++++++++++++
.../src/main/samples/actions/delete-file.hwf | 101 +++++++++++++
.../src/main/samples/actions/delete-files.hwf | 106 +++++++++++++
.../main/samples/actions/checks-if-files-exist.hwf | 166 +++++++++++++++++++++
5 files changed, 589 insertions(+)
diff --git a/plugins/actions/copyfiles/src/main/samples/actions/copy-files.hwf
b/plugins/actions/copyfiles/src/main/samples/actions/copy-files.hwf
new file mode 100644
index 0000000000..107c769e1e
--- /dev/null
+++ b/plugins/actions/copyfiles/src/main/samples/actions/copy-files.hwf
@@ -0,0 +1,114 @@
+<?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.
+
+-->
+<workflow>
+ <name>copy-files</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/11/09 08:58:27.732</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/11/09 08:58:27.732</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>112</xloc>
+ <yloc>224</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Copy files</name>
+ <description/>
+ <type>COPY_FILES</type>
+ <attributes/>
+ <copy_empty_folders>N</copy_empty_folders>
+ <arg_from_previous>N</arg_from_previous>
+ <overwrite_files>Y</overwrite_files>
+ <include_subfolders>Y</include_subfolders>
+ <remove_source_files>N</remove_source_files>
+ <add_result_filesname>N</add_result_filesname>
+ <destination_is_a_file>N</destination_is_a_file>
+ <create_destination_folder>Y</create_destination_folder>
+ <fields>
+ <field>
+
<source_filefolder>EMPTY_SOURCE_URL-0-${PROJECT_HOME}</source_filefolder>
+
<source_configuration_name>STATIC-SOURCE-FILE-0</source_configuration_name>
+
<destination_filefolder>EMPTY_DEST_URL-0-${PROJECT_HOME}/tmp-copy</destination_filefolder>
+
<destination_configuration_name>STATIC-DEST-FILE-0</destination_configuration_name>
+ <wildcard/>
+ </field>
+ </fields>
+ <parallel>N</parallel>
+ <xloc>384</xloc>
+ <yloc>224</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Copy files</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>70</height>
+ <xloc>112</xloc>
+ <yloc>128</yloc>
+ <note>The Copy Files action copies all files from ${PROJECT_HOME}
(config/projects/samples)
+to ${PROJECT_HOME}/tmp-copy (config/projects/samples/tmp-copy).
+The tmp-copy folder is created by the Copy Files action (see Settings
tab).</note>
+ <width>588</width>
+ </notepad>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/plugins/actions/createfile/src/main/samples/actions/create-file.hwf
b/plugins/actions/createfile/src/main/samples/actions/create-file.hwf
new file mode 100644
index 0000000000..8e0225de0c
--- /dev/null
+++ b/plugins/actions/createfile/src/main/samples/actions/create-file.hwf
@@ -0,0 +1,102 @@
+<?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.
+
+-->
+<workflow>
+ <name>create-file</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/11/09 09:28:39.755</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/11/09 09:28:39.755</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>144</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Create file</name>
+ <description/>
+ <type>CREATE_FILE</type>
+ <attributes/>
+ <add_filename_result>N</add_filename_result>
+ <fail_if_file_exists>Y</fail_if_file_exists>
+ <filename>${PROJECT_HOME}/create-file.txt</filename>
+ <parallel>N</parallel>
+ <xloc>336</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Create file</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>110</height>
+ <xloc>144</xloc>
+ <yloc>48</yloc>
+ <note>The Create File action creates an empty file. This is useful for
creating trigger files from within workflows.
+
+Example:
+The Create File action creates a new file at ${PROJECT_HOME}/create-file.txt.
(config/projects/samples/create-file.txt)
+If the file already exists, the step will fail (depending on the action
settings).</note>
+ <width>784</width>
+ </notepad>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/plugins/actions/deletefile/src/main/samples/actions/delete-file.hwf
b/plugins/actions/deletefile/src/main/samples/actions/delete-file.hwf
new file mode 100644
index 0000000000..dcd1258943
--- /dev/null
+++ b/plugins/actions/deletefile/src/main/samples/actions/delete-file.hwf
@@ -0,0 +1,101 @@
+<?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.
+
+-->
+<workflow>
+ <name>delete-file</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/11/09 09:35:39.756</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/11/09 09:35:39.756</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>144</xloc>
+ <yloc>176</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Delete file</name>
+ <description/>
+ <type>DELETE_FILE</type>
+ <attributes/>
+ <fail_if_file_not_exists>N</fail_if_file_not_exists>
+ <filename>${PROJECT_HOME}/create-file.txt</filename>
+ <parallel>N</parallel>
+ <xloc>352</xloc>
+ <yloc>176</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Delete file</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>110</height>
+ <xloc>144</xloc>
+ <yloc>32</yloc>
+ <note>The Delete File action deletes a file, whether empty or not.
+
+Example:
+Will delete "create-file.txt" created by create-file.hwf.
+NOTE: Will not fail if the file does not exist, see Action settings.</note>
+ <width>425</width>
+ </notepad>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/plugins/actions/deletefiles/src/main/samples/actions/delete-files.hwf
b/plugins/actions/deletefiles/src/main/samples/actions/delete-files.hwf
new file mode 100644
index 0000000000..16f3af6eb8
--- /dev/null
+++ b/plugins/actions/deletefiles/src/main/samples/actions/delete-files.hwf
@@ -0,0 +1,106 @@
+<?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.
+
+-->
+<workflow>
+ <name>delete-files</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/11/09 09:40:17.351</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/11/09 09:40:17.351</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>96</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Delete files</name>
+ <description/>
+ <type>DELETE_FILES</type>
+ <attributes/>
+ <arg_from_previous>N</arg_from_previous>
+ <fields>
+ <field>
+ <name>${PROJECT_HOME}/create-file.txt</name>
+ </field>
+ </fields>
+ <include_subfolders>N</include_subfolders>
+ <parallel>N</parallel>
+ <xloc>320</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Delete files</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>110</height>
+ <xloc>96</xloc>
+ <yloc>48</yloc>
+ <note>The Delete files action deletes a set of specified files,
optionally with subfolders.
+
+Example:
+Will delete "create-file.txt" created by create-file.hwf.
+NOTE: Will not fail if the file does not exist.</note>
+ <width>541</width>
+ </notepad>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/plugins/actions/fileexists/src/main/samples/actions/checks-if-files-exist.hwf
b/plugins/actions/fileexists/src/main/samples/actions/checks-if-files-exist.hwf
new file mode 100644
index 0000000000..4b9440000a
--- /dev/null
+++
b/plugins/actions/fileexists/src/main/samples/actions/checks-if-files-exist.hwf
@@ -0,0 +1,166 @@
+<?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.
+
+-->
+<workflow>
+ <name>checks-if-files-exist</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/11/09 08:26:44.934</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/11/09 08:26:44.934</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>112</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Checks if files exist (ture)</name>
+ <description/>
+ <type>FILES_EXIST</type>
+ <attributes/>
+ <fields>
+ <field>
+ <name>${PROJECT_HOME}/project-config.json</name>
+ </field>
+ </fields>
+ <parallel>N</parallel>
+ <xloc>688</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Checks if files exist (false)</name>
+ <description/>
+ <type>FILES_EXIST</type>
+ <attributes/>
+ <fields>
+ <field>
+ <name>${PROJECT_HOME}/project-config.json</name>
+ </field>
+ <field>
+ <name>${PROJECT_HOME}/project-config2.json</name>
+ </field>
+ </fields>
+ <parallel>N</parallel>
+ <xloc>320</xloc>
+ <yloc>192</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Checks if files exist (false)</from>
+ <to>Checks if files exist (ture)</to>
+ <enabled>Y</enabled>
+ <evaluation>N</evaluation>
+ <unconditional>N</unconditional>
+ </hop>
+ <hop>
+ <from>Start</from>
+ <to>Checks if files exist (false)</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>50</height>
+ <xloc>112</xloc>
+ <yloc>112</yloc>
+ <note>This action verifies the existence of one or more specified files.
+It checks each listed file and returns a successful (true) result only if all
the files exist. If any file is missing, the action fails (false).</note>
+ <width>849</width>
+ </notepad>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>30</height>
+ <xloc>208</xloc>
+ <yloc>256</yloc>
+ <note>project-config2.json doesn't exitst</note>
+ <width>235</width>
+ </notepad>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Segoe UI</fontname>
+ <fontsize>11</fontsize>
+ <height>30</height>
+ <xloc>624</xloc>
+ <yloc>256</yloc>
+ <note>project-config.json exists</note>
+ <width>176</width>
+ </notepad>
+ </notepads>
+ <attributes/>
+</workflow>