Class ExternalProcessCallNode


  • public class ExternalProcessCallNode
    extends Node
    Calls an external program that is used to convert streams.

    Streams that are passed to this node will first be converted to temporary files. Resulting files will be re-converted to Streams streams and passed to subsequent Nodes. Those files are deleted after the external program afterwards.

    This node can also act as a source or a sink in the workflow:

    • Field Detail

      • OUTFILE_PLACEHOLDER_PATTERN

        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}
        The resulting outfile will use the default extension getOutfileExtension()
        ${outfile:pdf}
        The resulting outfile will use the extension pdf
        Since:
        jadice server 4.5.1.0
    • Constructor Detail

      • ExternalProcessCallNode

        public ExternalProcessCallNode()
    • Method Detail

      • getWorkerClassName

        public String getWorkerClassName()
        Description copied from class: Node
        Return the node's associated com.levigo.jadice.server.core.NodeWorker full qualified class's name. By default, the worker class name is
        • The same as the node name with the trailing "Node" replaced by "Worker" if the node name ends in "Node"
        • The node class name with an appended "Worker" otherwise.
        The package name of the worker class is the name of the Node's package with an appended ".worker".

        This behavior can be overridden in concrete subclasses.

        Overrides:
        getWorkerClassName in class Node
        Returns:
        the full qualified class name of the worker of this node.
      • getArguments

        public String getArguments()
      • setArguments

        public void setArguments​(String arguments)
        Set the command line arguments. Optional placeholders are:
        INFILE_PLACEHOLDER
        for the position of the input filename
        OUTFILE_PLACEHOLDER
        for the position of the output filename with default extension
        ${outfile:ext}
        for the position of the output filename with extension ext

        Example: -s -a "${infile}" /convert="${outfile}" /log=${outfile:log}

        Parameters:
        arguments - The program's command line arguments
      • getOutfileExtension

        public String getOutfileExtension()
      • setOutfileExtension

        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

        Parameters:
        outfileExtension - Extension of the output file the external program expects
      • getProgramName

        public String getProgramName()
      • setProgramName

        public void setProgramName​(String programName)
        Set the path to the external program. E.g.: C:\Programme\Notepad++\Notepad++.exe
        Parameters:
        programName - Full path to the external program
      • isWaitForApplication

        public boolean isWaitForApplication()
      • setWaitForApplication

        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)
        Parameters:
        waitForApplication - if true the worker will wait for the external process to wait
      • isInfileEqOutfile

        public boolean isInfileEqOutfile()
      • setInfileEqOutfile

        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.
        Parameters:
        infileEqOutfile - if true the processed INPUT file will be passed
      • getOutputMimeType

        public String getOutputMimeType()
      • setOutputMimeType

        public void setOutputMimeType​(String outputMimeType)
        Set the MIME type of the result of this external process call. This helps subsequent Nodes as that information will be stored within the stream descriptor of the resulting stream.
        Parameters:
        outputMimeType - The MIME type of the external process call's result.
      • isDestroyRemainingProcessesOnAbort

        public boolean isDestroyRemainingProcessesOnAbort()
      • setDestroyRemainingProcessesOnAbort

        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.

        Parameters:
        destroyRemainingProcessesOnAbort - flag if external processes shall be destroyed when a Job is aborted or fails
      • setInputFilename

        public void setInputFilename​(String filename)
        Sets the filename for the input stream. Primary the filename from the StreamDescriptor is used.
        Parameters:
        filename - filename for the input stream
        See Also:
        StreamDescriptor.getFileName()
      • getInputFilename

        public String getInputFilename()