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
15 changes: 15 additions & 0 deletions integration-tests/samples/read-samples-build-hop-run.hpl
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,21 @@ var hop_run_cmd = './hop-run.sh -j samples -r ' + run_config + ' -f ' + filename
</value>
<conditions/>
</condition>
<condition>
<negated>Y</negated>
<operator>AND</operator>
<leftvalue>filename</leftvalue>
<function>CONTAINS</function>
<value>
<name>constant</name>
<type>String</type>
<text>/requires-setup/</text>
<length>-1</length>
<precision>-1</precision>
<isnull>N</isnull>
</value>
<conditions/>
</condition>
</conditions>
</condition>
</compare>
Expand Down
142 changes: 142 additions & 0 deletions plugins/actions/abort/src/main/samples/actions/abort.hwf
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?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>abort</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<created_user>-</created_user>
<modified_user>-</modified_user>
<created_date>2026/10/07 10:00:00.000</created_date>
<modified_date>2026/10/07 10:00:00.000</modified_date>
<created_hop_version/>
<modified_hop_version/>
<workflow_version/>
<parameters/>
<actions>
<action>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<intervalSeconds>0</intervalSeconds>
<intervalMinutes>60</intervalMinutes>
<DayOfMonth>1</DayOfMonth>
<weekDay>1</weekDay>
<minutes>0</minutes>
<hour>12</hour>
<doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<xloc>80</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<filename>${PROJECT_HOME}/project-config.json</filename>
<name>project-config.json exists?</name>
<description/>
<type>FILE_EXISTS</type>
<attributes/>
<xloc>272</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<loglevel>Basic</loglevel>
<logsubject/>
<logmessage>The file exists, processing continues.</logmessage>
<name>Continue</name>
<description/>
<type>WRITE_TO_LOG</type>
<attributes/>
<xloc>512</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<message>Required file ${PROJECT_HOME}/project-config.json is missing</message>
<loglevel>Error</loglevel>
<name>Abort</name>
<description/>
<type>ABORT</type>
<attributes/>
<xloc>272</xloc>
<yloc>400</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>project-config.json exists?</to>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
<enabled>Y</enabled>
</hop>
<hop>
<from>project-config.json exists?</from>
<to>Continue</to>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
<enabled>Y</enabled>
</hop>
<hop>
<from>project-config.json exists?</from>
<to>Abort</to>
<evaluation>N</evaluation>
<unconditional>N</unconditional>
<enabled>Y</enabled>
</hop>
</hops>
<notepads>
<notepad>
<note>The Abort action stops the workflow with an error, optionally with a message. Parent workflows and the hop-run command see the workflow as failed.
It is typically placed on the failure (red) hop of a check, to stop processing when a requirement is not met.

This sample checks for the project-config.json file of the samples project, which is always there, so the Abort action is not executed.
Change the filename in the File exists action to a file that does not exist to see the Abort action stop the workflow.</note>
<markdown>N</markdown>
<notetype>GENERAL</notetype>
<fontname>Segoe UI</fontname>
<fontsize>11</fontsize>
<fontbold>N</fontbold>
<fontitalic>N</fontitalic>
<fontcolorred>14</fontcolorred>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorblue>90</fontcolorblue>
<backgroundcolorred>201</backgroundcolorred>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorblue>251</backgroundcolorblue>
<bordercolorred>14</bordercolorred>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorblue>90</bordercolorblue>
<xloc>80</xloc>
<yloc>32</yloc>
<width>640</width>
<height>174</height>
</notepad>
</notepads>
<attributes/>
</workflow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
<?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>check-files-locked</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<created_user>-</created_user>
<modified_user>-</modified_user>
<created_date>2026/10/07 10:00:00.000</created_date>
<modified_date>2026/10/07 10:00:00.000</modified_date>
<created_hop_version/>
<modified_hop_version/>
<workflow_version/>
<parameters/>
<actions>
<action>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<intervalSeconds>0</intervalSeconds>
<intervalMinutes>60</intervalMinutes>
<DayOfMonth>1</DayOfMonth>
<weekDay>1</weekDay>
<minutes>0</minutes>
<hour>12</hour>
<doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<xloc>80</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<filename>${java.io.tmpdir}/hop-samples/check-files-locked/data.txt</filename>
<createParentFolder>Y</createParentFolder>
<appendFile>N</appendFile>
<content>Some data</content>
<encoding>UTF-8</encoding>
<name>Write data file</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<xloc>272</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<arg_from_previous>N</arg_from_previous>
<include_subfolders>N</include_subfolders>
<fields>
<field>
<name>${java.io.tmpdir}/hop-samples/check-files-locked</name>
<filemask>.*\.txt</filemask>
</field>
</fields>
<name>Files locked?</name>
<description/>
<type>CHECK_FILES_LOCKED</type>
<attributes/>
<xloc>464</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<loglevel>Basic</loglevel>
<logsubject/>
<logmessage>No file is locked, processing can start.</logmessage>
<name>Ready to process</name>
<description/>
<type>WRITE_TO_LOG</type>
<attributes/>
<xloc>656</xloc>
<yloc>256</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
<action>
<loglevel>Error</loglevel>
<logsubject/>
<logmessage>At least one file is locked, try again later.</logmessage>
<name>Files are locked</name>
<description/>
<type>WRITE_TO_LOG</type>
<attributes/>
<xloc>464</xloc>
<yloc>400</yloc>
<parallel>N</parallel>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>Write data file</to>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
<enabled>Y</enabled>
</hop>
<hop>
<from>Write data file</from>
<to>Files locked?</to>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
<enabled>Y</enabled>
</hop>
<hop>
<from>Files locked?</from>
<to>Ready to process</to>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
<enabled>Y</enabled>
</hop>
<hop>
<from>Files locked?</from>
<to>Files are locked</to>
<evaluation>N</evaluation>
<unconditional>N</unconditional>
<enabled>Y</enabled>
</hop>
</hops>
<notepads>
<notepad>
<note>The Check files locked action checks whether files are locked by another process, for example a file that is still being written or copied.
It succeeds when none of the files are locked.

This sample writes a file to ${java.io.tmpdir}/hop-samples/check-files-locked and checks that it is not locked before processing it.</note>
<markdown>N</markdown>
<notetype>GENERAL</notetype>
<fontname>Segoe UI</fontname>
<fontsize>11</fontsize>
<fontbold>N</fontbold>
<fontitalic>N</fontitalic>
<fontcolorred>14</fontcolorred>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorblue>90</fontcolorblue>
<backgroundcolorred>201</backgroundcolorred>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorblue>251</backgroundcolorblue>
<bordercolorred>14</bordercolorred>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorblue>90</bordercolorblue>
<xloc>80</xloc>
<yloc>32</yloc>
<width>736</width>
<height>138</height>
</notepad>
</notepads>
<attributes/>
</workflow>
Loading
Loading