You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Deutsche Version

Question

I would like to use variable path names when configuring a job chain. For example, to make the following job chain easier to use, I would like to neutralise the default local path:

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job_chain  orders_recoverable="yes" visible="yes"  title="com-ems-web-export" max_orders="1">
    <file_order_source   directory="D:/local-standard-dirs/Dometic/VMHANDOVER/com-ems-web-export/orders/start" regex=".*\.jobstart.xml"  max="1"/>

    <job_chain_node  state="initialize"  job="/vm/com-ems-web-export/initialize" next_state="transform"  error_state="error"/>
    <job_chain_node  state="transform"  job="/vm/com-ems-web-export/transform" next_state="deliver"  error_state="error"/>
    <job_chain_node  state="deliver"  job="/vm/com-ems-web-export/deliver" next_state="notification"  error_state="error"/>
    <job_chain_node  state="notification"  job="/vm/com-ems-web-export/notification" next_state="success"  error_state="error"/>

    <file_order_sink  state="error"  move_to="D:/local-standard-dirs/Dometic/VMHANDOVER/com-ems-web-export/orders/error"/>
    <file_order_sink  state="success"  move_to="D:/local-standard-dirs/Dometic/VMHANDOVER/com-ems-web-export/orders/success"/>
 </job_chain>

Answer

You can achieve this using environment variables.
Here is an example:

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job_chain  orders_recoverable="yes" visible="yes" title="VariableFileOrderSource" name="VariableFileOrderSource">
    <file_order_source  directory="$\{temp\}" regex=".*\.klaus"/>

    <job_chain_node  state="step100" job="FileCopyJob" next_state="step200" error_state="!step100"/>

    <job_chain_node  state="step200"/>

    <job_chain_node  state="!step100"/>
 </job_chain>

JobScheduler recognises these variables from the ${....} and replaces them. Note that they must have been defined in the environment before or when JobScheduler is started.

See also:

  • No labels