public class ExternalProcessCallNode extends Node
Calls an external program that is used to convert streams.
Stream
s that are passed to this node will first be converted to temporary files.
Resulting files will be re-converted to Stream
s streams and passed to subsequent
Node
s. Those files are deleted after the external program afterwards.
This node can also act as a source or a sink in the workflow:
INFILE_PLACEHOLDER
does not appear in the program arguments it is considered as a
source.OUTFILE_PLACEHOLDER
does appear nor the flag isInfileEqOutfile()
is set, this node is considered as a sink.Node.Cardinality
Modifier and Type | Field and Description |
---|---|
static String |
INFILE_PLACEHOLDER
Template for the
arguments that will replaced by the input file. |
static String |
OUTFILE_PLACEHOLDER
Template for the
arguments that will replaced by the output file. |
static Pattern |
OUTFILE_PLACEHOLDER_PATTERN
Matcher for the
OUTFILE_PLACEHOLDER . |
Constructor and Description |
---|
ExternalProcessCallNode() |
Modifier and Type | Method and Description |
---|---|
String |
getArguments() |
Node.Cardinality |
getInputCardinality()
Calculates the Input cardinality according to the
program arguments . |
String |
getInputFilename() |
String |
getOutfileExtension() |
Node.Cardinality |
getOutputCardinality()
Calculates the Output cardinality according to the
program arguments . |
String |
getOutputMimeType() |
String |
getProgramName() |
String |
getWorkerClassName()
Return the node's associated
NodeWorker full qualified class's
name. |
boolean |
isDestroyRemainingProcessesOnAbort() |
boolean |
isInfileEqOutfile() |
boolean |
isInputStreamExists() |
boolean |
isOutputStreamExists() |
boolean |
isWaitForApplication() |
void |
setArguments(String arguments)
Set the command line arguments.
|
void |
setDestroyRemainingProcessesOnAbort(boolean destroyRemainingProcessesOnAbort)
If this property is set to
true , the external processes started by this node will
be destroyed when the associated Job is aborted
or fails. |
void |
setInfileEqOutfile(boolean infileEqOutfile)
If the external program does not create a new (resulting) file but processes the input file,
this processed file can be passed to the subsequent workflow.
|
void |
setInputFilename(String filename)
Sets the filename for the input stream.
|
void |
setOutfileExtension(String outfileExtension)
Set the default extension of an temporary output file if needed, if not present in the argument
placeholders.
|
void |
setOutputMimeType(String outputMimeType)
Set the MIME type of the result of this external process call.
|
void |
setProgramName(String programName)
Set the path to the external program.
|
void |
setWaitForApplication(boolean waitForApplication)
Causes the Worker to wait until the process of the external program has terminated before it
passes the result the subsequent workflow.
|
protected void |
validateConfiguration() |
addTransportReceiver, appendSuccessor, apply, equals, getJob, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, initialize, prependPredecessor, remove
public static final String INFILE_PLACEHOLDER
arguments
that will replaced by the input file.public static final String OUTFILE_PLACEHOLDER
arguments
that will replaced by the output file.public static final Pattern OUTFILE_PLACEHOLDER_PATTERN
Matcher for the OUTFILE_PLACEHOLDER
. Enhanced by the capability to introduce a
parameter that hold the outfile's extension.
Examples:
${outfile}
getOutfileExtension()
${outfile:pdf}
public String getWorkerClassName()
Node
Return the node's associated
NodeWorker
full qualified class's
name. By default, the worker class name is
This behavior can be overridden in concrete subclasses.
getWorkerClassName
in class Node
public String getArguments()
public void setArguments(String arguments)
Set the command line arguments. Optional placeholders are:
INFILE_PLACEHOLDER
OUTFILE_PLACEHOLDER
default
extension
${outfile:ext}
ext
Example:
-s -a "${infile}" /convert="${outfile}" /log=${outfile:log}
arguments
- The program's command line argumentspublic String getOutfileExtension()
public void setOutfileExtension(String outfileExtension)
Set the default extension of an temporary output file if needed, if not present in the argument placeholders.
Example: .jpg
outfileExtension
- Extension of the output file the external program expectspublic String getProgramName()
public void setProgramName(String programName)
Set the path to the external program. E.g.: C:\Programme\Notepad++\Notepad++.exe
programName
- Full path to the external programpublic boolean isWaitForApplication()
public void setWaitForApplication(boolean waitForApplication)
Causes the Worker to wait until the process of the external program has terminated before it
passes the result the subsequent workflow. (default: true
)
waitForApplication
- if true
the worker will wait for the external process to
waitpublic boolean isOutputStreamExists()
true
iff an output stream will exists (i.e. OUTFILE_PLACEHOLDER
was set in the program argument
).public boolean isInputStreamExists()
true
iff an input stream will exists (i.e. INFILE_PLACEHOLDER
was
set in the program argument
).public boolean isInfileEqOutfile()
public void setInfileEqOutfile(boolean infileEqOutfile)
If the external program does not create a new (resulting) file but processes the input file,
this processed file can be passed to the subsequent workflow. Therefore the value must be set
to true
.
infileEqOutfile
- if true the processed INPUT file will be passedpublic String getOutputMimeType()
public void setOutputMimeType(String outputMimeType)
Set the MIME type of the result of this external process call. This helps subsequent
Node
s as that information will be stored within the stream descriptor
of the resulting stream.
outputMimeType
- The MIME type of the external process call's result.protected void validateConfiguration() throws ConfigurationException
validateConfiguration
in class Node
ConfigurationException
public boolean isDestroyRemainingProcessesOnAbort()
public void setDestroyRemainingProcessesOnAbort(boolean destroyRemainingProcessesOnAbort)
If this property is set to true
, the external processes started by this node will
be destroyed
when the associated Job is aborted
or fails.
Default value is false
so that is not guaranteed that no idling processes remain.
destroyRemainingProcessesOnAbort
- flag if external processes shall be destroyed when a
Job is aborted or failspublic Node.Cardinality getInputCardinality()
program arguments
.getInputCardinality
in class Node
public Node.Cardinality getOutputCardinality()
program arguments
.getOutputCardinality
in class Node
public void setInputFilename(String filename)
StreamDescriptor
is used.filename
- StreamDescriptor.getFileName()
public String getInputFilename()
Copyright © 2017 levigo holding gmbh. All rights reserved.