Public Interfaces

This chapter contains information about the public interfaces part of the com.technia.tias.executor.api. package. The JS executor within TIF cloud has one object bound to the code named context. This context object is of type ExecutionContext. From this context object you will be able to access different APIs in orderto perform the job.

Configuration

Represents a Configuration instance

Since 2022-09-15

Public Member Functions

Signature Returns Description Arguments

id()

UUID

Returns the internal ID of the configuration.

name()

String

Returns the name of the configuration.

content()

String

Returns the content of the configuration.

type()

String

Returns the type of the configuration

properties()

Map< String, String >

Returns the properties of this configuration.

ConfigurationResolver

The configuration resolver is used to resolve other Configuration instances.

Since 2022-02-01

Public Member Functions

Signature Returns Description Arguments

getConfiguration(String name)

Configuration

Resolves a configuration with the given name.

name

The name of the configuration to resolve.

ConverterAPI

The converter API contains various methods for converting files between different formats.

Since 2023-10-02

Public Member Functions

Signature Returns Description Arguments

convertToPDF()

PDFConversionRequest

Obtains the PDF converter API. NOTE: If you do not have the correct license for the PDF converter, this method will throw an exception when called.Creates a request object, which will allow you to convert an Office document, such as a DOCX, XLSX, etc file into PDF.The generated PDF file may contain watermarks based on image and/or text. Moreover, the generated PDF file can be signed using a digital certificate.The PDF conversion itself can be preceded by setting document properties, in case the input file is a Microsoft Word or Excel file. The properties are set and fields can be configured to be updated prior to the PDF conversion in order to reflect values from the properties.

Credentials

Holds some secret credentials data.

Since 2022-09-15

Public Member Functions

Signature Returns Description Arguments

id()

String

The ID of the credentials

Data

A Data instance holds data associated with a job. A job can get data as input and return data as output. It is also possible for a particular job to generate other Data content as part of the execution.

Since 2022-01-31

Public Member Functions

Signature Returns Description Arguments

getName()

String

Returns the name of this data instance.

getType()

DataType

Returns the type for this data instance, if known.

getDescription()

String

Returns the description for this data instance, if known.

getInputStream()

InputStream

This method returns an InputStream from which you can read all the bytes of this data instance.

getContentType()

String

Returns the content type of the data, if known.

getContentEncoding()

String

Returns the content encoding if known.In most cases UTF8 will be used if this information is not provided and there is a need to convert bytes into characters or vice versa.

getContentAsString()

String

Tries to convert the data into a String using the encoding as specified via the getContentEncoding() method. If that method returns null, UTF-8 is the assumed encoding to be used when converting the bytes into characters.

getSize()

long

Returns the size of the data content if known. A negative value can be returned to indicate that the size is not known.

DataRef

A Data reference is a reference to o Data instance. A reference only provides the meta data and not the actual content of the data. To load the actual content of the data/file, use the DataStorage API available on the ExecutionContext.

Since 2022-02-18

Public Member Functions

Signature Returns Description Arguments

id()

UUID

Returns the ID of the referenced Data instance

name()

String

Returns the name

description()

String

Returns the description (if known)

size()

long

Returns the size of the data

dataType()

DataType

Returns the type of data this is, one of INBOUND, OUTBOUND or OTHER is returns

contentType()

String

Returns the content type (if known)

contentEncoding()

String

Returns the content encoding (if known)

DataStorage

API for reading and storing Data instances.

Since 2022-01-31

Public Member Functions

Signature Returns Description Arguments

list()

DataRef

Lists all data associated with the current job. Note that this method returns the meta-data only. To retrieve the actual content for a Data instance you need to query that separately via the load method .

store(Data data)

UUID

Stores the given data

data

The data to be stored

load(UUID byId)

Data

Loads data by its ID. Null is returned if there is no such Data

byId

The ID

load(String byName)

Data

Loads data by its name.

byName

The name

delete(UUID byId)

boolean

Deletes a data instance by its ID

byId

The ID

delete(String byName)

boolean

Deletes a data instance by its name

byName

The name

change(UUID id, String newName, DataType newType)

-

This function allows renaming and/or re-typing a specific file.

id

The id of the file to change

newName

If not null, then a rename operation is assumed.

newType

If not null, then a re-typing operation is assumed

newStringDataBuilder()

StringDataBuilder

Creates and return a new string data builder instance

newByteArrayDataBuilder()

ByteArrayDataBuilder

Creates and return a new byte array data builder instance

DocumentHelperService

This service helps out when working with documents and files from TIAS.

Public Member Functions

Signature Returns Description Arguments

getFileContent(String documentId, String fileId)

byte[]

Returns the content of a file as a byte-array.

documentId

The ID of the document, which the file belongs to. (REQUIRED)

fileId

The ID of the file to get the contents of. (REQUIRED)

download(String documentId, String fileId, boolean lock)

LocalFileAPI.LocalFile

Downloads or check-outs the given file into a local-file

documentId

The ID of the document, which the file belongs to. (REQUIRED)

fileId

The ID of the file to get the contents of. (REQUIRED)

lock

True to lock the file (e.g. perform a check-out)

uploadNew(LocalFileAPI.LocalFile localFile, String documentId, String checkinFileName, String checkinComments)

-

Uploads the local file as a new file into the given Document object.

localFile

The local file to checkin (REQUIRED)

documentId

The ID of the document to upload the file to (REQUIRED)

checkinFileName

If you wish to use another name for the file than the local file name, specify here (OPTIONAL)

checkinComments

Checkin comments (OPTIONAL)

uploadFileVersion(LocalFileAPI.LocalFile localFile, String documentId, String fileId, String checkinFileName, String checkinComments, boolean keepLocked)

-

Creates a new version of an existing file.If you know the ID of the file to be revised, supply the fileId argument.If you omit the fileId, then the file to be revised will be queried for by checking the current files on the document object.

localFile

The local file to checkin (REQUIRED)

documentId

The ID of the document to upload the file to (REQUIRED)

fileId

If known, the ID of the file to be revised. (OPTIONAL)

checkinFileName

If you wish to use another name for the file than the local file name, specify here (OPTIONAL)

checkinComments

Checkin comments (OPTIONAL)

keepLocked

True to keep the file locked

DsxAPI

API to access the DS REST API.

Since 2022-02-03

Public Member Functions

Signature Returns Description Arguments

getTenantSession()

TenantSession

#getTenantSession(AppService)DeprecatedThis method will be removed! Use the getTenantSession taking an argument.

getTenantSession(String appId)

TenantSession

Returns the session to be used for a particular DS application.

appId

The ID of the DS application such as "space", "exchange" etc.

getTenantSession(AppService appService)

TenantSession

Returns a session to the specified AppService.

appService

The service to obtain the session for

getSpaceService()

SpaceService

Returns the space service.

getExchangeService()

ExchangeService

Returns the Exchange service provider

getDocumentHelperService()

DocumentHelperService

Returns the document helper service that simplifies working with files stored in the DS File Store.

DsxUrls

Holds various DSX URLs that is required to know when accessing the DS tenant.

Since 2022-09-15

Public Member Functions

Signature Returns Description Arguments

passport()

String

Returns the passport URL

space()

String

Returns the 3d-space URL

swym()

String

Returns the swym URL

exchange()

String

Returns the exchange URL

compass()

String

Returns the compass URL

drive()

String

Returns the 3d-drive URL

Environment

Holds environmental data that is needed in the Executor.

Since 2022-02-02

Public Member Functions

Signature Returns Description Arguments

getDSXTenantName()

String

Returns the name of the DSX tenant.

dsxUrls()

DsxUrls

Returns all configured DSX URLs

get(String name)

String

Returns the value of the environment variable with the given name. Null is returned in case there is no env variable with such name.

name

The name of the env variable

get(String name, String defaultValue)

String

Returns the value of the environment variable with the given name. In case there is no env variable with the given name, the provided default value is returned.

name

The name of the env variable

defaultValue

The default value to fallback to in case there is no such env variable.

getEnvVariables()

Set< String >

Returns the names of the environment variables.

getSecret(String name)

String

Returns the value of a secret variable.Use secret variables with caution, for example the value should never be logged etc. Also, every usage of a secret variable is tracked/logged.

name

The name of the secret variable.

getMacroResolver()

MacroResolver

Returns a macro resolver that can resolve dynamic values from the environment OR secrets.

isFeatureInstalled(String featureId)

boolean

Checks if a given feature is available.

featureId

The ID of the feature to check

ExecutionContext

When executing an integration job, the ExecutionContext provides access to various services and APIs needed to conduct for example HTTP calls, performing JSON serialization or deserialization, access data from the 3DEXPERIENCE platform via the DSX-REST API’s or performing some conversion or other computation. There are also APIs available for accessing environment variables, secret variables or for logging of actions performed by the executor. Also, there are APIs allowing you to access any input parameters, variables or payload that has been passed into the job. If the job was triggered by an event, the event details is also available via the ExecutionContext API. The ExecutionContext also provides APIs to return the result from the job execution via the ExecutionResult API. There you can set the success flag, provide a result code and with a message / detailed message including any outgoing payload data. The result of a job execution can be associated with so called outbound payload data. Commonly, a job is associated with one outbound payload data, but you are not limited to that. If a job is associated with multiple outbound payload data files, these are typically avaiable / returned as a ZIP archive when delivered back to the caller.

Public Member Functions

Signature Returns Description Arguments

input()

ExecutionInput

Returns an object holding any input data available to the job. The input may vary depending on how the job was invoked. For example, if the job was triggered by a REST call, then the input data may hold various request headers, variables, parameters and/or request payload. However, if the job was triggered by, for example, a Scheduled Task or an Event from the 3DEXPERIENCE platform, then the input contains different kinds of data.

result()

ExecutionResult

Returns an object allowing to specify the result/outcome from the execution of this job.

localFileAPI()

LocalFileAPI

Returns an object that allows working wil local file resource. A local file resource will only live during the execution of a job, hence this should not be used for anything else than just processing of data related to the execution of the job.

dsxAPI()

DsxAPI

Returns an object that provides access to the 3D-Experience REST API.

httpAPI()

HttpAPI

Returns an object that provides functionality to perform HTTP(S) calls from the executor.

jsonAPI()

JsonAPI

Returns an object that provides functionality related to converting objects back/forth JSON representation.

xmlAPI()

XmlAPI

Returns an object that provides functionality related to XML document parsing, transformation and processing.

jobAPI()

JobAPI

Returns an object that provides functionality related to Job handling within TIAS.

utilsAPI()

UtilitiesAPI

Returns an object that provides miscellaneous utility functions related to commonly used tasks done as part of executing a Job.

property(String key)

String

Returns the value of the property by first querying the underlying configuration for a property with the given key. If the configuration does not provide a value for the given key, then the environment will be queried.

key

The key/name of the property.

configuration()

Configuration

Returns the configuration object related to this execution.

configurationResolver()

ConfigurationResolver

Returns an object that can be used to obtain content of other configurations .

logger()

ExecutorLogger

Returns a logger, which the executor may use to associate log-data with the current job. Do not log sensitive data to the logger such as credentials or other tokens, etc.

dataStorage()

DataStorage

Returns an object that provides functionality related to storage of data instances. In contradiction to the local file API that is cleaned up after the job execution competes, the data storage API can be used to store long-term data.Be aware of that the data will be cleaned up at a later time, depending on settings this time may vary, but in general, after 60 days, the data will be archived.

environment()

Environment

Returns an environment object that provides functionality to get environment variables, secret variables and some other DSX related properties as declared from the Administration UI.Note that the environment may contain sensitive data so be careful how to use these and avoid log these.

jobRequestMessage()

JobRequestMessage

Returns an object that describes the job-request it-self. For example, this object contains the ID of the job being executed, among others.

converterAPI()

ConverterAPI

Returns an API object, which provides conversion capabilities.

configData()

< T > T

Optional configuration data attached with the execution of the job. This value might be null in most cases, but for example, when using the Custom Feature concept - this method will provide the configuration data from this method.

<T>

The type of the configuration data

extension()

ExtensionInfo

For executor implementations part of a TIF extension, this API provides access to metadata from the extension itself. For example, accessing the UI Configuration values and definition, among others.NOTE: This method returns NULL if the code is not part of an extension.

exit()

-

Calling exit will terminate any further execution of the ongoing job-executor. The state of the job will be determined by the result API .

sleep(long milliSeconds)

-

Pauses the execution of this job for the requested number of milliseconds.The value is in milliseconds and may not be less than 1 ms or greater than 30,000 ms (30 seconds). If so, an exception will be thrown and the execution will exit.Notice also that if you call this method repeatedly, the total time paused MAY not exceed 5 minutes. If so, an exception will be thrown.

milliSeconds

The number of milliseconds to pause. See the rules above.

ExecutionInput

Contains methods to access all necessary input data for the current Job.

Since 2022-06-21

Public Member Functions

Signature Returns Description Arguments

getParentJobId()

UUID

If this job was triggered by another job, then the ID of that parent job is available from this method. In any other case, null is returned.

path()

String

For example, if the job was invoked via a REST call then this method returns the path used.

header(String name)

List< String >

Returns the headers associated with the given name. If there are no headers available with the specified name, then this method returns an empty list, never null.

name

The name of the header

firstHeader(String name)

String

Returns the first header value associated with the given name. Note that if no header is present with the given name, null will be returned from this method.

name

The name of the header

getHeaders()

Map< String, List< String > >

Returns the optional headers that may have been passed along when the job was invoked.

param(String name)

List< String >

Returns the parameter associated with the given name. If there are no parameter available with the specified name, then this method returns an empty list, never null.

name

The name of the parameter

firstParam(String name)

String

Returns the first parameter value associated with the given name. Note that if no parameter is present with the given name, null will be returned from this method.

name

The name of the parameter

getParameters()

Map< String, List< String > >

Returns all optional parameters passed along when the job was created.

variable(String name)

String

Returns the variable associated with the given name. If there is no variable available with the specified name, then this method returns null.

name

The name of the variable to return

getVariables()

Map< String, String >

Returns all optional variables that were resolved when the job was created. Variables are typically those that are resolved from the URL when the job was requested via a REST call and the URL contained macros / URI variables.

data()

InputData

Returns the input data if available.

isProcessingReply()

boolean

Returns true if we are processing a reply, e.g. this job is a result of an execution of an asynchronous reply.

isRetry()

boolean

Returns true if this execution is a retry attempt, e.g. for some reason the previous execution failed and we are now trying to recover from that state. Note that it is the executor that is responsible for handling retries in a reliable way.

getRetryAttempt()

int

If this is a retry attempt, this method will return the attempt no.

ExecutionResult

Holds the result of the job execution.

Since 2022-06-21

Public Member Functions

Signature Returns Description Arguments

isFailed()

boolean

If the job failed, this method returns true.

isMarkResolved()

boolean

Returns true if the resolved flag has been set.

getResolution()

String

Returns the resolution message if set.

isAwaitingReply()

boolean

If the job has been marked as awaiting a reply from some other system, this method will return true.

isCancelled()

boolean

Returns the cancellation flag.

getCode()

Integer

The result code set on the result. If no code is set, null is returned.

getMessage()

String

Typically, if the job is marked as being failed, then this method returns the message giving some brief information about the problem.

getDetailedMessage()

String

Detailed message to be associated with this job result, typically used when a job is failed.

cancelled(boolean cancelled)

ExecutionResult

Sets the cancelled flag.

cancelled

True to mark the job as being cancelled

failed(boolean failed)

ExecutionResult

Sets the failed flag.

failed

True to mark the job as being failed

markResolved(boolean resolved, String resolutionMessage)

ExecutionResult

Can be used to set the resolved flag and the resolution message. Note that setting a resolution also requires the job to be marked as failed.

resolved

True to mark the job as being resolved

resolutionMessage

The resolution message

awaitingReply(boolean awaitingReply)

ExecutionResult

Sets the awaitingReply flag.

awaitingReply

to put the job in a state signalling, it is waiting for an asynchronous reply.

code(Integer code)

ExecutionResult

Associates the code with the execution result. This could be used in addition to the message and detailed message to easier identify problems in various places.

code

The code to be set.

message(String message)

ExecutionResult

Associates the specified message with the execution result.

message

The message to save

detailedMessage(String detailedMessage)

ExecutionResult

Associates a more detailed description or stack trace, etc. that is helpful to understand the error.

detailedMessage

The detailed message to save

data(String content, String contentType)

ExecutionResult

Associates some data with the result. The data is string based and you should specify the content-type.

content

The data content

contentType

The type of data

data(String content, String contentType, String fileName)

ExecutionResult

Associates some data with the result. The data is string based and you should specify the content-type. If fileName argument is null or empty, the default file name will be used.

content

The data content

contentType

The type of data

fileName

Then name of the file

data(byte[] content, String contentType, String encoding)

ExecutionResult

Associates some binary data with the result.

content

The content

contentType

Content type

encoding

Encoding

data(byte[] content, String contentType, String encoding, String fileName)

ExecutionResult

Associates some binary data with the result.

content

The content

contentType

Content type

encoding

Encoding

fileName

Then name of the file

Executor

An Executor is responsible for executing the logic of an integration job in the TIF Cloud platform. An executor can be implemented in various different ways, for example, there are executors that allows the job logic to be expressed in some scripting language, for example JavaScript, within a configuration. The configuration content is then a Javascript that is performing all tasks required to fulfill the job.

Since 2022-02-01

Public Member Functions

Signature Returns Description Arguments

execute(ExecutionContext context)

-

Performs the execution of the Job based upon the provided context input.

context

The context

ExecutorLogger

A logger that is used to associate messages of different kind to a job. Note that messages that is being logged should be kept short, each message should not exceed 256 chars but MAY not exceed 1024 chars. Such message will be truncated.

Public Member Functions

Signature Returns Description Arguments

isDebugEnabled()

boolean

Tells if debug logging is enabled

debug(String message, Object…​ arguments)

-

Logs a message with the DEBUG level. Note that the DEBUG level must be enabled separately per service as it may generate a lot of outputIf one or more arguments are passed, the message value is used as format string and passed to String.format along with the given arguments

message

The message to log

arguments

Optional arguments to be used when formatting the message

info(String message, Object…​ arguments)

-

Logs a message with the info level.If one or more arguments are passed, the message value is used as format string and passed to String.format along with the given arguments

message

The message to log

arguments

Optional arguments to be used when formatting the message

warning(String message, Object…​ arguments)

-

Logs a message with the warning level.If one or more arguments are passed, the message value is used as format string and passed to String.format along with the given arguments

message

The message to log

arguments

Optional arguments to be used when formatting the message

error(String message, Object…​ arguments)

-

Logs a message with the error level.If one or more arguments are passed, the message value is used as format string and passed to String.format along with the given arguments

message

The message to log

arguments

Optional arguments to be used when formatting the message

ExtensionInfo

This API provides the executing code with details of the extension, which the code belongs to. This API is only relevant for TIF Cloud Extension developers.

Since 2023-12-15

Public Member Functions

Signature Returns Description Arguments

name()

String

Returns the name of the extension.

installedVersion()

int

Returns the major version of the installed extension.NOTE, since an extension now can have a combination of a major and minor version value, this method have been marked as deprecated. It will be removed at some point in the future.For backward compatibility, when calling this method, it will return the major version.Deprecated#installedMajorVersion()#installedMinorVersion()

installedMajorVersion()

int

Returns the major version of the installed extension.

installedMinorVersion()

int

Returns the minor version of the installed extension.

installedBuildNumber()

int

Returns the build number of the installed extension.

released()

boolean

Returns true if the installed extension is a RELEASED version.

uiConfigValues()

Map<?, ?>

Returns the UI configuration values entered via the admin UI screen or screens related to the Extension.

uiConfigDefinition()

Map<?, ?>

Returns the UI configuration definition itself. This is useful in case the extension needs to resolve default values or query the definition for something.

Headers

Headers API

Public Member Functions

Signature Returns Description Arguments

names()

Collection< String >

Returns the names of the headers. The returned collection is immutable.

contains(String name)

boolean

True if there is a header with the given name

name

The name of the header

get(String name)

String

Returns the first header with the given name.

name

The name of the header to return

getAll(String name)

List< String >

Returns all headers with the given name

name

The name of the header

toMap()

Map< String, List< String > >

Returns all headers copied into a new map.Note that changes to the returned map is NOT reflected in this instance.

HttpAPI

A simple http API that can be used to invoke remote services in an easy fashion.

Since 2022-09-14

Public Member Functions

Signature Returns Description Arguments

newRequestBuilder()

RequestBuilder

Creates a new request builder to be used for building up new requests.

newRequestBuilder(String destinationName)

RequestBuilder

Creates a new request builder instance, populating the builder with all settings defined in the destination with the given name.Note that if a destination with the given name was not found, an exception will be raised.

destinationName

The name of the destination to populate the request builder from.

generateBasicAuthToken(String username, String password)

String

Convenient method to generate a Basic authentication token.

username

The username

password

The password

InputData

Represents the input data that for example is passed along when a job is being created.

Since 2022-06-22

Public Member Functions

Signature Returns Description Arguments

size()

long

Returns the size of the input data, e.g. the number of bytes.

stream()

InputStream

Returns the data as an stream .

content()

byte[]

Returns the data as a byte array.

type()

String

Returns the content type representing the data, if known.

contentAsString()

String

Tries to convert the data into a string, assuming the bytes stored contains character based data.Note that if the data is not character based, this method will most likely just return garbage chars. There is no check whether or not the content-type is a valid content type for the operation.

encoding()

String

The encoding used when converting string based data into bytes.

JobAPI

Contains various methods for spawning new jobs or request information from other jobs.

Since 2022-09-16

Public Member Functions

Signature Returns Description Arguments

setSourceObject(String id, String type, String name, String revision, String status, String info)

-

Sets the source object for the current running job.When an event triggers a job, the source object is most of the time resolved automatically. However, when triggering a job via a REST call or via a Scheduled Task, this is not the case and in such situations the running logic may call this method to associate the job with a source object.Note that there is no logic in place that will validate the passed in values.

id

The physical ID of the source object

type

The type of the source object

name

The name of the source object

revision

The revision of the source object

status

The current state/status of the source object

info

Additional information associated with the source object.

setJobDescription(String description)

-

Sets the job-description for the current running job.

description

The description of this job

addJobTags(String…​ tags)

-

Adds extra tags to the current job.

tags

The tags to be added

awaitDSExchangeJob(String id, boolean isExport)

-

When requesting exchange export or import jobs via the DS Enterprise Exchange API, such job is created asynchronously.In order to be able to route the result from that asynchronous processing into this Job for future processing within TIF, you need to call this method.That will ensure that this job is marked as awaiting reply and will be invoked once TIF receives notification that the exchange job with the given ID is ready.

id

The ID of the exchange Job to await result from

isExport

True if the job is of type export, false if it is an import.

newJob()

JobRequestBuilder

resolveInput(UUID jobId)

ExecutionInput

Resolves the input for another job with the given ID.

jobId

The ID of the job to get the input for.

loadDataFrom(UUID jobId, String withName)

Data

Loads a data instance from another job with the given name.

jobId

The ID of the job to get the data for

withName

The name of the data to retrieve

JobRequest

Job request is the object used to perform the actual job-request with.

Public Member Functions

Signature Returns Description Arguments

perform()

UUID

Performs the job request and returns the ID of the new job.

JobRequestBuilder

This builder is used to build/setup new JobRequest instances.

Public Member Functions

Signature Returns Description Arguments

configuration(String configurationRef)

JobRequestBuilder

Specify what configuration to be used for the new job

configurationRef

The name of the configuration to be used (required)

input(byte[] data, String contentType, String encoding)

JobRequestBuilder

Associate some input data with the new job

data

The data in a byte array representation

contentType

The content type for the data

encoding

The optional encoding to be used if the data is converted to a String representation.

param(String name, String…​ value)

JobRequestBuilder

Associates a param name / value (or values) with the new job.If an existing parameter is present with the same name, the values are added to the previous parameter list.If the value argument is set to null, the parameter is removed.

name

The name of the parameter (not null)

value

The value or values of the parameter (null value implies removing existing value with given name).

header(String name, String…​ value)

JobRequestBuilder

Associates a header name / value (or values) with the new job.If an existing header is present with the same name, the values are added to the previous header value list.If the value argument is set to null, the header is removed.

name

The name of the header (not null)

value

The value or values of the header (null value implies removing existing header with given name).

jobTag(String tag)

JobRequestBuilder

Adds a job-tag to be associated with the new job.

tag

The tag to associate the new job with

build()

JobRequest

Builds the immutable JobRequest that is used to perform the actual job request with

JobRequestMessage

Contains data from the job request message.

Since 2022-09-15

Public Member Functions

Signature Returns Description Arguments

jobId()

UUID

Returns the ID of the job itself.

source()

String

eventMappingId()

UUID

jobName()

String

configurationId()

UUID

agentCredentials()

Credentials

securityContext()

String

sourceEvent()

SourceEvent

JsonAPI

Contains various common JSON related tasks such as serialize and deserialize JSON data.

Since 2022-09-14

Public Member Functions

Signature Returns Description Arguments

readValue(String json, Class< T > type)

< T > T

Tries to convert a JSON string into a Java object of the given type.

json

The JSON data to de-serialize

type

The type of class to deserialize into

<T>

The type

writeValue(Object value, OutputStream destination)

-

Converts a Java object into a JSON string representation and writes the bytes of this string encoded with UTF-8 encoding to the given OutputStream.Note: the stream is not closed

value

The value to write

destination

The destination to write the value into

serialize(Object value)

String

Serializes a Java object into a JSON string representation.

value

The java object to serialize

LocalFile

LocalFile API

Public Member Functions

Signature Returns Description Arguments

fileName()

String

name()

String

path()

String[]

size()

long

outputStream()

OutputStream

inputStream()

InputStream

loadText(@Nullable String charset)

String

Loads the content of the file as a text. Using either the specified charset, or UTF-8 if not specified, to convert the bytes into a string.

charset

Optional charset name

saveText(@Nullable String text, @Nullable String charset)

-

Saves the text to the file using either the specified charset, or UTF-8 if not specified, to convert the String into bytes.

text

The text to save. Null implies empty.

charset

Optional charset name

load()

byte[]

Reads all bytes from the file into memory.

save(byte[] data)

-

Saves the bytes into the file.

data

The data to be saved.

toData(String overrideFileName, String contentType, String contentEncoding, String description)

Data

Converts this instance to a Data instance to be used with the data storage API and having its data-type set to OTHER.

toOutboundData(String overrideFileName, String contentType, String contentEncoding, String description)

Data

Converts this instance to a Data instance to be used with the data storage API and having its data-type set to OUTBOUND.

exists()

boolean

Returns true if the file actually exists.

delete()

-

Deletes this file

LocalFileAPI

API for storing/handling files temporarily during a job execution. These files are short lived and will be removed once the job execution completes. NOTE: We will implement file-quota support in the near future, meaning that you will NOT be able to store more data than a certain threshold, which depends on the environment settings.

Since 2023-03-06

Public Member Functions

Signature Returns Description Arguments

extract(@NonNull LocalFile file, @Nullable String dirName)

LocalFile

Tries to extract a compressed file into a directory with the given name.The supported compression formats are: * ZIP* …​If the dirName is omitted, then the root directory is being used.

file

The file to be de-compressed.

dirName

Optional directory prefix to be added to all extracted entries of the compressed file

compress(@NonNull LocalFile destFile, @Nullable String dirName, @Nullable String targetDir)

-

Creates a compressed archive, e.g. a ZIP file, of all files available from the local-file area within the given directory.For example, if you have the following files in your local file area: * test/file1.txt* test/file2.txt* test/test/file3.txtAnd you call this method with the following arguments: fileAPI.compress(zipFile, 'test', null); Then the ZIP file will contain the following entries: * file1.txt* file2.txt* test/file3.txtIf you would have called this method with the following arguments: fileAPI.compress(zipFile, 'test', 'a/b/c'); Then the ZIP file will contain the following entries: * a/b/c/file1.txt* a/b/c/file2.txt* a/b/c/test/file3.txt

destFile

The destination ZIP file

dirName

The root dir to use when adding the files.

targetDir

The target dir prepended to each entry in the final ZIP file.

list()

LocalFile

Lists all files and returns them in a List

exists(String name)

boolean

Checks if there is a local file with the given name.

name

The name of the file.

get(String name)

LocalFile

Retrieves a local file with the given name. If there is no such file, null will be returned.

name

The name of the file

create(String name)

LocalFile

Creates a new LocalFile instance that can be used to store data in a temporary / local file. Note that the file does not exist until you have written anything to the actual file.

name

The name of the file.

saveLocal(Data data, String overrideName)

LocalFile

Saves a data instance as a local file

data

The data instance to save.

overrideName

Optional name to use when saving the file locally. If omitted, the data-name is used.

LocalFileDownloadResponse

This class is a subclass to com.technia.tias.executor.api.HttpAPI.ResponseInfo.

Represents a response, where the data is kept in a LocalFile.

Public Member Functions

Signature Returns Description Arguments

file()

LocalFileAPI.LocalFile

Returns the local file, which contains the response data.

Inherited Public Functions

Signature Returns Description Arguments

requestMethod()

HttpAPI.Method

Returns the actual method used when the request was performed

requestURL()

String

Returns the requested URL

statusCode()

int

Returns the HTTP status code

statusMessage()

String

Returns the HTTP status message

succeeded()

boolean

This method returns true in case the HTTP status code is 2xx.

contentType()

String

Returns the content type for the response, if known.

contentLength()

long

Returns the size of the response body in bytes.

charset()

Charset

The character set for the response data, if known and the response data represents character based data.

headers()

Headers

Returns the response headers.

MacroResolver

A macro resolver is capable of resolving dynamic values from a string. Depending on the implementing class, the values are resolved from different sources.

Since 2023-10-13

Public Member Functions

Signature Returns Description Arguments

apply(String input)

String

Resolves any macros in the input string and returns the resolved value.If the input string is null, this method will return null.

input

The input string.

MultiPartRequestBuilder

Builder used to create multi-part form-data requests, e.g. file uploads.

Public Member Functions

Signature Returns Description Arguments

param(String name, Object value)

MultiPartRequestBuilder

Adds a post parameter/value to be sent along with the request.

name

The name of the parameter

value

The value. A null value is simply ignored.

file(String name, String fileName, byte[] content)

MultiPartRequestBuilder

Adds a file to be uploaded.

name

The name of the parameter to send the file as.

fileName

The name of the file

content

The actual bytes of the file to send

file(String name, String fileName, InputStream inputStream)

MultiPartRequestBuilder

Adds a file to be uploaded.NOTE: the stream is NOT closed, that is the callers responsibility.

name

The name of the parameter to send the file as.

fileName

The name of the file

inputStream

The stream containing the bytes to send.

file(String name, String fileName, LocalFileAPI.LocalFile localFile)

MultiPartRequestBuilder

Adds a file to be uploaded.

name

The name of the parameter to send the file as.

fileName

The name of the file

localFile

The local file to upload. Note that the file must be a true file, otherwise an IllegalArgumentException will be thrown.

and()

RequestBuilder

Completes the building of the request body and returns the request builder .

PDFConversionRequest

Contains various methods to configure the PDF conversion request. Converting a document to PDF may include the following steps:

  • Setting document properties

  • Optionally forcing field update

  • Export document to PDF (with/without security options applied)

  • Apply Watermarks

  • Digitally sign the PDF file

Public Member Functions

Signature Returns Description Arguments

inputFile(LocalFileAPI.LocalFile file)

PDFConversionRequest

Specifies what input file to be used

file

The input file

properties()

SetProperties

Returns the set-properties object allowing to configure the setting of properties on the input file prior to the PDF conversion takes place.

pdf()

PDFConversionSettings

Returns the PDF conversion settings object allowing configuration of the PDF conversion/export.

merge()

PDFMergeSettings

Returns an object that can be used to configure merge of PDF document, like adding title pages and/or ending pages.

watermark()

PDFWatermarksSettings

Returns the watermark settings allowing you to configure watermarks to be applied on the generated PDF document.

convertToImage()

PDFToImageSettings

Returns the convert-to-image settings used for configuring the PDF to image conversion.

sign()

PDFSignSettings

Returns the sign settings allowing you to configure any PDF digital signature

perform(LocalFileAPI.LocalFile saveTo)

PDFConversionResult

Performs the PDF conversion according to configured behavior.

saveTo

The file, which to save the converted file into.

PDFConversionResult

Holds the result of the PDF conversion

Public Member Functions

Signature Returns Description Arguments

isSuccessful()

boolean

Contains information if the PDF conversion was successful or not.

getErrorMessage()

String

If the PDF conversion failed, this method should provide error details.

getResult()

LocalFileAPI.LocalFile

Returns the file holding the converted PDF file.

PDFConversionSettings

Configures the PDF conversion itself.

Public Member Functions

Signature Returns Description Arguments

and()

PDFConversionRequest

Completes the pdf conversion setting configuration

archiveMode(int archiveMode)

PDFConversionSettings

Specifies the PDF/Archive mode level. Values of 1,2,3 represents the following modes: * PDF/A-1 Part 1: Use of PDF 1.4 2005-09-28 ISO 19005-1 PDF 1.4 (Adobe Systems, PDF Reference, third edition)* PDF/A-2 Part 2: Use of ISO 32000-1 2011-06-20 ISO 19005-2 PDF 1.7 (ISO 32000-1:2008)* PDF/A-3 Part 3: Use of ISO 32000-1 with support for embedded files 2012-10-15 ISO 19005-3 PDF 1.7 (ISO 32000-1:2008)Any other integer disables the PDF/A mode.

archiveMode

The archive mode. Accepts any integer, but values 1,2,3 represents any of the above mentioned modes.

useLosslessCompression(Boolean useLosslessCompression)

PDFConversionSettings

Specifies if graphics are exported to PDF using a lossless compression eg. PNG or if they are compressed using the JPEG format.

useLosslessCompression

True if to use loss less compression of the exported images.

jpegQuality(Integer jpegQuality)

PDFConversionSettings

Specifies quality of the JPG export. A higher value results in higher quality and file.Minimum inclusive value: 1. Represents lowest value that can be used. The lower the value, the less good is the compression quality and the bigger is be the file size.Maximum inclusive value:100. Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size.

jpegQuality

The JPEG quality value

reduceImageResolution(Boolean reduceImageResolution)

PDFConversionSettings

Specifies if the resolution of each image is reduced to the resolution specified by the maxImageResolution(Long) .If you reduce the image resolution but do not specify the max image resolution, 300 DPI is the image resolution used.

reduceImageResolution

True to reduce the image resolution

maxImageResolution(Long maxImageResolution)

PDFConversionSettings

Sets the max image resolution value in DPI.Allowed values are: * 75* 150* 300* 600* 1200

maxImageResolution

The max image resolution in DPI.

useTaggedPDF(Boolean useTaggedPDF)

PDFConversionSettings

Determines if PDF are created by using special tags also known as Tagged PDF.

useTaggedPDF

True to use tagged PDF

exportBookmarks(Boolean exportBookmarks)

PDFConversionSettings

Specifies if bookmarks are exported to PDF.

exportBookmarks

True to export bookmarks

exportFormFields(Boolean exportFormFields)

PDFConversionSettings

Specifies whether form fields are exported as widgets or only their fixed print representation is exported.

exportFormFields

True if to export form fields

exportNotes(Boolean exportNotes)

PDFConversionSettings

Specifies if notes are exported to PDF.

exportNotes

True to export notes.

exportBookmarksToPDFDestination(Boolean exportBookmarksToPDFDestination)

PDFConversionSettings

Specifies that the bookmarks contained in the source file should be exported to the PDF file as Named Destination (see PDF 1.4 section 8.2.1).

exportBookmarksToPDFDestination

True to export bookmarks to PDF destinations

embedStandardFonts(Boolean embedStandardFonts)

PDFConversionSettings

Specifies whether to embed the 14 standard PDF fonts or not.

embedStandardFonts

True to embed standard fonts

inputPassword(String inputPassword)

PDFConversionSettings

Special use case when input file is a PDF file and the input file is password protected.

inputPassword

The input PDF file password

documentOpenPassword(String documentOpenPassword)

PDFConversionSettings

If set to a non null value enforces encrypted PDF file with a user password being set.

documentOpenPassword

The password to be used when opening the document

changePermissionPassword(String changePermissionPassword)

PDFConversionSettings

This is the password that allows the user to access some permissions

changePermissionPassword

The change permission password / the master password.

printingRule(int printingRule)

PDFConversionSettings

Specifies what printing is allowed.The allowed values are: * 0: Undefined* 1: Not Printable* 2: Print with low resolution* 3: Print with max resolution (default)

printingRule

The printing rule value

changeRule(int changeRule)

PDFConversionSettings

Specifies the change allowed to the document.The allowed values are: * 0: Undefined (default)* 1: No changes* 2: Insert/delete/rotate page* 3: Fill form fields* 4: Fill form fields and commenting* 5: All except page extraction

changeRule

The change rule value.

enableCopyingOfContent(Boolean enableCopyingOfContent)

PDFConversionSettings

Specifies that the pages and the document content can be extracted to be used in other documents (copy and paste).

enableCopyingOfContent

False to disable copying of content

enableTextAccessForAccessibilityTools(Boolean enableTextAccessForAccessibilityTools)

PDFConversionSettings

Specifies that the document content can be extracted to be used in accessibility applications.

enableTextAccessForAccessibilityTools

False to disable text access for accessibility tools

PDFMergeDocument

Contains information about a document to be merged

Public Member Functions

Signature Returns Description Arguments

and()

PDFMergeSettings

Return the PDFMergeSettings when done. This is useful for method chaining.

file(LocalFileAPI.LocalFile file)

PDFMergeDocument

Sets the file to be used for the merge operation. The file can either be a PDF file or an Office document.

file

The file to be merged. If null is specified, this merge information is considered invalid.

applyProperties(boolean value)

PDFMergeDocument

Controls if properties will be transferred to the document that will be merged also. This operation can only be done on Office documents, so for PDF documents this flag has no effect. Per default, the same properties as set on the main document will be set on the other document.

value

True (the default) to set properties, false to skip.

PDFMergeSettings

Contains methods that allows you to merge the main document with for example a title page and/or ending page. The merge documents can either be PDF documents or standard Office documents. For the latter, document properties can also be propagated before they are converted into PDF.

Public Member Functions

Signature Returns Description Arguments

and()

PDFConversionRequest

Completes the pdf conversion setting configuration

addTitlePage()

PDFMergeDocument

Adds a title page

addEndingPage()

PDFMergeDocument

Adds a title page

addTitlePage(LocalFileAPI.LocalFile file)

PDFMergeSettings

Shorter variant for adding a title page, this method does not allow any additional configuration.

file

The file to be used as title page.

addEndingPage(LocalFileAPI.LocalFile file)

PDFMergeSettings

Shorter variant for adding an ending page, this method does not allow any additional configuration.

file

The file to be used as ending page.

PDFSignSettings

Specify PDF signing settings

Public Member Functions

Signature Returns Description Arguments

pfxFile(LocalFileAPI.LocalFile file)

PDFSignSettings

If a personal information exchange file is being used for the certificates, you need to define what the name of this file is.

file

The PFX file

pfxType(String pfxType)

PDFSignSettings

Specifies the type of PFX, for example "pkcs12" or similar. Default type is pkcs12.

pfxType

The PFX store type

password(String password)

PDFSignSettings

The password for the PFX

password

The password

publicKeyFile(LocalFileAPI.LocalFile file)

PDFSignSettings

If using a X.509 certificate, point out the public key file using this.The file must be in PEM format.

file

The public X509 certificate file in PEM format.

privateKeyFile(LocalFileAPI.LocalFile file)

PDFSignSettings

The private key must be provided in PEM format, and be a RSA private key

file

THe file holding the RSA private key in PEM format.

tsaURL(String tsaUrl)

PDFSignSettings

Allows to configure a custom TSA URL to be used over the default.

tsaUrl

The TSA URL to be used

and()

PDFConversionRequest

Completes the sign settings and returns the request instance

PDFToImageSettings

Contains settings related to PDF to Image conversion

Public Member Functions

Signature Returns Description Arguments

dpi(Integer dpi)

PDFToImageSettings

Configures the DPI value for the images.

dpi

The DPI

ignoreFirstPage(Boolean ignoreFirstPage)

PDFToImageSettings

Explicitly exclude the first page

ignoreFirstPage

True to ignore the first page

ignoreLastPage(Boolean ignoreLastPage)

PDFToImageSettings

Explicitly exclude the last page.

ignoreLastPage

True to ignore the last page.

imageFormat(String imageFormat)

PDFToImageSettings

The image format. Accepted values are "PNG" or "JPG". Default is PNG if unspecified.

imageFormat

The image format

imageType(String imageType)

PDFToImageSettings

Configures the image type. Accepted values are: "RGB", "RGBA", "GRAY", "BINARY" (or "BW") or "BGR".

imageType

The image type value. Default is RGB

fileNameFormat(String fileNameFormat)

PDFToImageSettings

Configures the file name format for each image. The format can contain a format identifer to map the current page number.

fileNameFormat

The file name format

pageRange(String pageRange)

PDFToImageSettings

Configure custom page ranges to extract. Example value: 1-2,4,10-

pageRange

The page range spec

and()

PDFConversionRequest

Completes the pdf-to-image configuration

PDFWatermark

Contains common settings for both image and text based watermarks. <T>The type of watermark (Image / Text).

PDFWatermarkImage

Contains Image based watermark specific settings

Public Member Functions

Signature Returns Description Arguments

image(LocalFileAPI.LocalFile file)

PDFWatermarkImage

Configures what image to be used as watermark. The given file must be a valid image otherwise the operation will fail.

file

The image containing the watermark image

PDFWatermarkText

Contains text based watermark specific settings.

Public Member Functions

Signature Returns Description Arguments

text(String text)

PDFWatermarkText

Defines the text to be used

text

The text

fontName(String fontName)

PDFWatermarkText

The name of the font to be used.NOTE: ONLY A LIMITED SET OF FONTS ARE AVAILABLE, WE WILL CLARIFY THE LIST HERE

fontName

The name of the font to be used (Arial, Verdana etc).

fontSize(int fontSize)

PDFWatermarkText

Declares the size of the font

fontSize

The font size.

fontStyle(String fontStyle)

PDFWatermarkText

Declares the font-style to be used

fontStyle

The font style (plain, italic, bold, italic+bold)

fontColor(String fontColor)

PDFWatermarkText

Sets the font color

fontColor

The font color (hex code)

PDFWatermarksSettings

Defines watermark settings

Public Member Functions

Signature Returns Description Arguments

addImage()

PDFWatermarkImage

Adds an image based watermark

addText()

PDFWatermarkText

Adds a text based watermark

and()

PDFConversionRequest

Completes the watermark configuration

ParamValue

Represents a query string parameter value

Public Member Functions

Signature Returns Description Arguments

getRaw()

String

Returns the raw value

getURLEncoded()

String

Returns the URL encoded value that is used when transmitting the value

PostParamsBuilder

Declares common methods for adding parameters to be part of the POST request.

Public Member Functions

Signature Returns Description Arguments

param(String name, Object value)

PostParamsBuilder

Adds a name/value pair.

name

The name of the parameter

value

The value of the parameter

params(String name, Object…​ values)

PostParamsBuilder

Adds a parameter with the given name and given values .

name

The name of the parameter

values

The values for the parameter

params(String name, List< Object > values)

PostParamsBuilder

Adds a parameter with the given name and given values .

name

The name of the parameter

values

The values for the parameter

and()

RequestBuilder

Completes the addition of post-parameters and returns the parent request builder to be used to configure the request further with.

Request

Request API

Public Member Functions

Signature Returns Description Arguments

perform()

Response

Performs the request and waits for the response

download(LocalFileAPI.LocalFile to)

LocalFileDownloadResponse

Performs the request and stores the response body into the given file reference .

to

The destination file. May not be null.

RequestBuilder

API for building a request.

Public Member Functions

Signature Returns Description Arguments

url()

UrlBuilder

Returns an url builder , which helps you construct complex URLs. Subsequent calls to this method will return the same UrlBuilder instance.

url(String url)

RequestBuilder

Specifies the URL to be used.

url

The URL to call

get(String url)

RequestBuilder

Sets the request method to GET with the specified URL

url

The URL to invoke

post(String url)

RequestBuilder

Sets the request method to POST with the specified URL

url

The URL to invoke

put(String url)

RequestBuilder

Sets the request method to PUT with the specified URL

url

The URL to invoke

patch(String url)

RequestBuilder

Sets the request method to PATCH with the specified URL

url

The URL to invoke

delete(String url)

RequestBuilder

Sets the request method to DELETE with the specified URL

url

The URL to invoke

method(Method method)

RequestBuilder

Sets the request method to use

method

The HTTP method

method(String method)

RequestBuilder

Sets the request method to use

method

The HTTP method as a string

header(String name, String value)

RequestBuilder

Adds a header with the given name and value.NOTE: If the value is null, the header with the given name is removed.

name

The name of the header (not null)

value

The value of the header (null allowed).

headers(String name, Collection< String > values)

RequestBuilder

Adds a header with the given name and values.Most headers are single values, but some allows multiple values such as the Cookie header.NOTE:If the value is null, the header with the given name is removed.

name

The name of the header (not null)

values

The collection of values for the header (null allowed).

headers(Map< String, String > headerMap)

RequestBuilder

Sets the headers as provided from the map argumentIf the map contains an already defined header, the old value will be replaced with the new value.

headerMap

The map holding the headers to be set.

authorization(String value)

RequestBuilder

Sets the header "Authorization" to the given value

value

The value to use for the Authorization header.

acceptsJson()

RequestBuilder

Sets the header "Accept" to the value "application/json".

jsonBody(String jsonBody)

RequestBuilder

Sets the body to the given content and using content-type "application/json".

jsonBody

The content type value

body(String contentType, String body)

RequestBuilder

Sets the body text to be sent

contentType

The content type describing the body content

body

The body text

bodyFromBlob(String contentType, byte[] blob)

RequestBuilder

Sets a blob / byte array as body

contentType

The content type describing the body content

blob

The binary data

bodyFromFile(String contentType, LocalFileAPI.LocalFile file)

RequestBuilder

Sets the body content to be sent from the content of the given file.Note that this method will not conduct a multipart file upload, it will just send the content of the file part of the request body.

contentType

The content type representing the data (null allowed)

file

The file to get the body from.

multiPartRequest()

MultiPartRequestBuilder

Creates a builder for creation of multipart form-data requests.

postParams()

PostParamsBuilder

connectTimeout(long timeoutInMilliSeconds)

RequestBuilder

Sets the default connect timeout in milliseconds for new connections.A value of 0 means no timeout, otherwise values must be between 1 and Integer.MAX_VALUE.The connect timeout is applied when connecting a TCP socket to the target host.The default value is 20 seconds.

timeoutInMilliSeconds

The timeout in milliseconds

callTimeout(long timeoutInMilliSeconds)

RequestBuilder

Sets the timeout in milliseconds for the complete calls.A value of 0 means no timeout, which is the default value, otherwise values must be between 1 and Integer.MAX_VALUE.The call timeout spans the entire call: resolving DNS, connecting, writing the request body, server processing, and reading the response body.If the call requires redirects or retries all must complete within one timeout period.The default value is 0 which imposes no timeout.

timeoutInMilliSeconds

The timeout in milliseconds

readTimeout(long timeoutInMilliSeconds)

RequestBuilder

Sets the read timeout in milliseconds for new connections.A value of 0 means no timeout (which is NOT recommended to use), otherwise values must be between 1 and Integer.MAX_VALUE.The read timeout is applied to both the TCP socket and for individual read IO operations including on Source of the Response.The default value is 30 seconds.

timeoutInMilliSeconds

The timeout in milliseconds

writeTimeout(long timeoutInMilliSeconds)

RequestBuilder

Sets the default write timeout in milliseconds for new connections.A value of 0 means no timeout (which is NOT recommended to use), otherwise values must be between 1 and Integer.MAX_VALUE.The write timeout is applied for individual write IO operations.The default value is 30 seconds.

timeoutInMilliSeconds

The timeout in milliseconds

followRedirects(boolean value)

RequestBuilder

Specifies whether or not to follow redirectsThe default value is TRUE.

value

True if to follow redirects

build()

Request

Completes the building process and returns the immutable Request object that can be used to perform the HTTP call.

Response

This class is a subclass to com.technia.tias.executor.api.HttpAPI.ResponseInfo.

Standard HTTP response API

Public Member Functions

Signature Returns Description Arguments

bodyText()

String

Returns the body as a string

body()

byte[]

Gives access to the raw body data as a byte array.

Inherited Public Functions

Signature Returns Description Arguments

requestMethod()

HttpAPI.Method

Returns the actual method used when the request was performed

requestURL()

String

Returns the requested URL

statusCode()

int

Returns the HTTP status code

statusMessage()

String

Returns the HTTP status message

succeeded()

boolean

This method returns true in case the HTTP status code is 2xx.

contentType()

String

Returns the content type for the response, if known.

contentLength()

long

Returns the size of the response body in bytes.

charset()

Charset

The character set for the response data, if known and the response data represents character based data.

headers()

Headers

Returns the response headers.

ResponseInfo

Contains common response related information

Public Member Functions

Signature Returns Description Arguments

requestMethod()

HttpAPI.Method

Returns the actual method used when the request was performed

requestURL()

String

Returns the requested URL

statusCode()

int

Returns the HTTP status code

statusMessage()

String

Returns the HTTP status message

succeeded()

boolean

This method returns true in case the HTTP status code is 2xx.

contentType()

String

Returns the content type for the response, if known.

contentLength()

long

Returns the size of the response body in bytes.

charset()

Charset

The character set for the response data, if known and the response data represents character based data.

headers()

Headers

Returns the response headers.

SetProperties

Used to declare properties to be set on a document

Public Member Functions

Signature Returns Description Arguments

add(String name, Object value)

SetProperties

Adds a key/value property.

name

The name of the property

value

The value of the property. Can be of type String, Integer, Date, Boolean, Float or Double.

forceFieldUpdate(boolean value)

SetProperties

Set to true to force update of fields in Word documents. Have no effect on other document types than DOCX files.

value

True to force the field update.

updateExcelFieldRefs(boolean value)

SetProperties

Set to true to iterate cells in the Excel spreadsheet to update links/refs to document properties. Have no effect on other document types than Excel files.

value

True to force the field update.

and()

PDFConversionRequest

Completes the set properties configuration

SourceEvent

Contains data from the source event that triggered this job.

Since 2022-09-15

Public Member Functions

Signature Returns Description Arguments

eventType()

String

Returns the event type.

eventClass()

String

Returns the event class.

user()

String

Returns the 3DX user

authorization()

String

Returns the authorization value.

objectId()

String

Returns the identifier of the source object causing the event to be fired.

objectType()

String

Returns the type of the source object causing the event

objectRelativePath()

String

Returns the relative path to the source object causing the event

objectSource()

String

Returns the source to the source object causing the event

objectRef()

Referable

Returns the source as a referable instance

state()

String

If the event was a status changed event, this method returns the state of the object. Otherwise this method return null.

TransformResult

Represents a result from an XML transformation. This object allows accessing the output properties, if available, from the transformation process.

Public Member Functions

Signature Returns Description Arguments

getOutputProps()

Map< String, String >

Returns the output properties. This method will never return null.

getStream()

InputStream

Returns a stream, from which the transformation result can be read.

getSource()

Source

Returns the transformation result as a Source object.

getResult(String charset)

String

Returns the result as a string

charset

Optional charset specifying how to convert bytes to chars. If null, UTF-8 is assumed unless the charset can be obtained from the transformation output.

UrlBuilder

API for building a URL.

Public Member Functions

Signature Returns Description Arguments

getUrl()

String

Returns the URL, without any query string parameters.

base(String url)

UrlBuilder

Sets the base url.

url

The base URL to be set

path(String path)

UrlBuilder

Appends some path to the existing URL

path

The URI path to append to the URL

replacePathVariables(Map< String, Object > keyValues)

UrlBuilder

Replaces path variables like ${VARIABLE_1} from values in the given map. Variables are defined using the $\{} syntax.

keyValues

The map containing the variables and their corresponding values to be substituted.

removeParams()

UrlBuilder

Removes all query string parameters associated with this builder.

removeParam(String name)

UrlBuilder

Removes a parameter with the given name

name

The name of the parameter to be removed

param(String name, String value)

UrlBuilder

Adds a parameter with the given name/value.

name

The name of the parameter

value

The value of the parameter

params(String name, String…​ value)

UrlBuilder

Adds a parameter with the given name and values.

name

The name of the parameter

value

The values of the parameter

param(String name, ParamValue value)

UrlBuilder

Special variant where the value is provided as a ParamValue instance.

name

The name of the parameter

value

The value

params(String name, ParamValue…​ values)

UrlBuilder

Special variant where the values are provided as ParamValue instances.

name

The name of the parameter

values

The values

containsParam(String name)

boolean

Returns true if this UrlBuilder contains a parameter with the given name

name

The name of the parameter to be removed

getParams(String name)

List< String >

Returns the parameters with the given name, if any. This method will never return null, only an empty list if there are no values for the requested parameter.Note that the returned list is immutable.

name

The name of the parameter to get

and()

RequestBuilder

Returns the parent request builder .

UtilitiesAPI

This API provides various methods commonly used by job execution code.

Since 2023-09-08

Public Member Functions

Signature Returns Description Arguments

base64Encode(byte[] data)

String

Encodes an array of bytes into a base 64 encoded string.

data

The array of bytes to encode

base64Decode(String b64EncodedString)

byte[]

Decodes a base64 encoded String into a byte array.

b64EncodedString

The String to be decoded

base64Encode(String input, String encoding)

String

Encodes a string into a base64 representation. The input string is first converted to bytes using the specified encoding.

input

The input string. If null, null is returned from this method

encoding

The encoding to be used. If null, UT-8 is used.

base64DecodeToString(String b64EncodedString, String encoding)

String

Decodes a base 64 encoded string into a string. The decoded bytes are converted to a string using the provided encoding.

b64EncodedString

The base 64 encoded string. If null, null is returned.

encoding

The encoding to be used. If null, UT-8 is used.

XmlAPI

Contains various methods to perform XML / XSLT / XPATH related operations.

Since 2023-05-31

Public Member Functions

Signature Returns Description Arguments

toDOM(String xml)

Document

Parses a string containing XML data into a DOM Document

xml

The string containing the XML data

toDOM(LocalFileAPI.LocalFile file)

Document

Parses a file containing XML data into a DOM Document

file

The file holding the XML data

toSource(String xml)

Source

Creates a Source representation of the XML data held in the given String.

xml

The string containing XML data.

toSource(Document document)

Source

Creates a Source representation of the XML DOM tree.

document

The DOM document

transform(Source xml, Source xslt, Map< String, ?> params)

TransformResult

Transforms XML data using an XSLT stylesheet into another format.

xml

The XML data to transform

xslt

The XSLT stylesheet to be used

params

Optional parameters to send to the stylesheet

transform(Source xml, Source xslt, LocalFileAPI.LocalFile to, Map< String, ?> params)

TransformResult

Transforms the XML data using an XSLT stylesheet into the given file .

xml

The XML data to transform

xslt

The XSLT stylesheet to be used

to

The file destination

params

Optional parameters to send to the stylesheet

serialize(Document document)

String

Serializes a DOM document into a string representation

document

The DOM document object

serialize(Document document, LocalFileAPI.LocalFile to)

-

Serializes a DOM document into a file

document

The DOM document object

to

The destination file

serialize(Document document, OutputStream out)

-

Serializes a DOM document into an output stream

document

The DOM document object

out

The output stream to write the XML data to

serialize(Document document, Writer writer)

-

Serializes a DOM document into a writer.

document

The DOM document object

writer

The writer to write the XML data to

prettyPrint(Document document)

String

Generate a pretty formatted string of the DOM document

document

The document object to convert to a string

prettyPrint(Source src)

String

Generate a pretty formatted string of the XML source

src

The source object

prettyPrint(Document document, Writer writer)

-

Writes the DOM document in a pretty format to the given writer.

document

The document object to serialize

writer

The destination writer.

prettyPrint(Node node)

String

Generate a pretty formatted string of the DOM node

node

The node to convert to a string

prettyPrint(Node node, Writer writer)

-

Writes the DOM node in a pretty format to the given writer.

node

The node to serialize

writer

The destination writer.

selectNodes(Node from, String expression)

NodeList

Evaluates an XPath expression starting from the given node and returns a list of matched nodes.

from

The start node

expression

The XPath expression to evaluate

filterElements(NodeList nodes)

Iterator< Element >

From the provided NodeList argument, filter out Element nodes only

nodes

The node list to filter.

selectValue(Node from, String expression, XPathReturnType returnType)

String

Evaluates an XPath expression starting from the given node and returns the result as a string.The returnType argument declares return value your XPath expression will select. Based on that, the output is converted into a String value.Null is an accepted value for the returnType argument, which implies that the Xpath return will be treated as a NODE.

from

The start node

expression

The XPath expression to evaluate

returnType

The XPath return type. If null is provided, the expected output is a NODE.

selectValues(Node from, String expression, XPathReturnType returnType)

List< String >

Evaluates an XPath expression starting from the given node and returns the result as a list of strings.The returnType argument declares what return value your XPath expression will select. Based on that, the output is converted into String values.Null is an accepted value for the returnType argument, which implies that the Xpath return will be treated as a NODESET.

from

The start node

expression

The XPath expression to evaluate

returnType

The XPath return type. If null is provided, the expected output is a NODESET.

newWriter(LocalFileAPI.LocalFile file, String encoding)

XmlWriter

Creates a new xml writer that can be used to write XML data to the given file.

file

The file to write the XML data into.

encoding

The encoding, null implies UTF-8.

newWriter(Appendable appendable)

XmlWriter

Creates a new xml writer that can be used to write XML data into an appendable .The appendable could for example be a StringBuilder instance, or some other object implementing the Appendable interface.

appendable

The object to write the XML data into.

XmlWriter

Writes XML documents. Note that if you try to produce invalid XML data, that will cause runtime exceptions to be thrown by the API. This class is following the fluent API pattern in order to make it easier to develop and read the code used to construct XML data.

Public Member Functions

Signature Returns Description Arguments

documentStart()

XmlWriter

Write the start of the document.

documentStart(String encoding, String version)

XmlWriter

Write the start of the document.

encoding

The encoding

version

The version

dtd(String dtd)

XmlWriter

Writes a doc type decl.

dtd

The entire doc type decl.

entityRef(String name)

XmlWriter

writeNamespace(String prefix, String namespaceURI)

XmlWriter

cdata(String cdata)

XmlWriter

comment(String comment)

XmlWriter

startElement(String localName)

XmlWriter

Write a start element.

localName

The tag name.

startElement(String prefix, String localName, String namespaceURI)

XmlWriter

startElement(String namespaceURI, String localName)

XmlWriter

startElement(String localName, Map< String, String > attributes)

XmlWriter

Write a start element with attributes.

localName

The tag name.

attributes

The attributes.

text(String string)

XmlWriter

Writes the specified text.

string

Text to write.

attribute(String localName, String value)

XmlWriter

Write an attribute to the currently open start tag.

localName

The attribute name.

value

The attribute value.

attribute(String namespaceURI, String localName, String value)

XmlWriter

Write a namespace associated attribute to the currently open start tag-

namespaceURI

The namespace URI

localName

The local name of the attribute

value

The attribute value

attribute(String prefix, String namespaceURI, String localName, String value)

XmlWriter

Write a namespace associated attribute to the currently open start tag-

prefix

The prefix

namespaceURI

The namespace URI

localName

The local name of the attribute

value

The attribute value

endElement()

XmlWriter

Close the current tag.

textElement(String element, String text)

XmlWriter

Write a text element.

element

The tag name.

text

The body text.

textElement(String localName, Map< String, String > attributes, String text)

XmlWriter

Write a text element with attributes.

localName

The tag name.

attributes

The attributes.

text

The body text..

emptyElement(String element)

XmlWriter

Write an empty element.

element

The tag name.

documentEnd()

XmlWriter

Write the end of the document.

close()

-

Closes this writer.

Public Enum Types

This chapter contains information about the public Enum constants part of the com.technia.tias.executor.api. package.

DataType

A Data object is associated with a type, such as if the data is representing outbound data, inbound data or some other kind of data such as generated / converted data.

Since 2022-02-17

Enum Constants

To access an enum constant from the JS code, use this syntax:

// Load the enum class DataType
const DataType=Java.type('com.technia.tias.executor.api.DataType');

// Access the enum constant later on like this:
DataType.NAME_OF_CONSTANT;

Where NAME_OF_CONSTANT is one of the constants from the enum to access, see the table below for available constants.

Name Description

OUTBOUND

Specifies outbound data

INBOUND

Specifies inbound data

OTHER

Used for data that neither can be categorized as inbound nor outbound data.

Public Static Functions

To be able to call a static method on a class from the JS code, use this syntax:

const DataType=Java.type('com.technia.tias.executor.api.DataType');
DataType.nameOfMethod(...)
Signature Returns Description Arguments

fromString(String s)

DataType

Safe parsing a string into a DataType value.

s

The string to parse.

Method

Represents the available Http Methods

Enum Constants

To access an enum constant from the JS code, use this syntax:

// Load the enum class Method
const Method=Java.type('com.technia.tias.executor.api.HttpAPI.Method');

// Access the enum constant later on like this:
Method.NAME_OF_CONSTANT;

Where NAME_OF_CONSTANT is one of the constants from the enum to access, see the table below for available constants.

Name Description

GET

POST

PUT

PATCH

DELETE

OPTIONS

HEAD

Public Static Functions

To be able to call a static method on a class from the JS code, use this syntax:

const Method=Java.type('com.technia.tias.executor.api.HttpAPI.Method');
Method.nameOfMethod(...)
Signature Returns Description Arguments

fromString(String method)

Method

XPathReturnType

Declares different kind of XPath return types.

Enum Constants

To access an enum constant from the JS code, use this syntax:

// Load the enum class XPathReturnType
const XPathReturnType=Java.type('com.technia.tias.executor.api.XmlAPI.XPathReturnType');

// Access the enum constant later on like this:
XPathReturnType.NAME_OF_CONSTANT;

Where NAME_OF_CONSTANT is one of the constants from the enum to access, see the table below for available constants.

Name Description

NODE

Declares that a given XPath expression returns a single node.

NODESET

Declares that a given XPath expression returns a set of nodes.

NUMBER

Declares that a given XPath expression returns a numeric value

STRING

Declares that a given XPath expression returns a string value

BOOLEAN

Declares that a given XPath expression returns a boolean value

Public Static Functions

To be able to call a static method on a class from the JS code, use this syntax:

const XPathReturnType=Java.type('com.technia.tias.executor.api.XmlAPI.XPathReturnType');
XPathReturnType.nameOfMethod(...)
Signature Returns Description Arguments

fromString(String value)

XPathReturnType

Safe parse of a string into a ReturnType instance without throwing any exception, which the valueOf does.

Public Classes

This chapter contains information about the public classes part of the com.technia.tias.executor.api. package.

ByteArrayData

This class is a subclass to com.technia.tias.executor.api.InMemoryData.

Data implementation holding binary content as a byte array in memory.

Since 2022-09-22

Public Constructors

To be able to load the class from the JS code, use this syntax:

const ByteArrayData=Java.type('com.technia.tias.executor.api.ByteArrayData');
let instance = new ByteArrayData(... args ...);
Signature Description Arguments

ByteArrayData(byte[] data, String contentType, Charset charset, String name, String description, DataType dataType)

Constructs a new immutable ByteArrayData instance.

data

The data

contentType

The content type of the data

charset

The charset for the data

name

The name associated with this data

description

An optional description for this data

dataType

The type of data.

Public Static Functions

To be able to call a static method on a class from the JS code, use this syntax:

const ByteArrayData=Java.type('com.technia.tias.executor.api.ByteArrayData');
ByteArrayData.nameOfMethod(...)
Signature Returns Description Arguments

newBuilder()

ByteArrayDataBuilder

Creates a new ByteArrayDataBuilder instance

Inherited Public Functions

Signature Returns Description Arguments

getName()

String

Returns the name of this data.

getType()

DataType

Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER.

getDescription()

String

Returns a description of the data.

getInputStream()

InputStream

Returns an inputstream that contains the bytes representing the data.

getContentType()

String

Returns the content type.

getContentEncoding()

String

Returns the content encoding.

getContentAsString()

String

Tries to convert the data into a String using the encoding as specified via the getContentEncoding() method. If that method returns null, UTF-8 is the assumed encoding to be used when converting the bytes into characters.

getSize()

long

Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used.

getBytes()

byte[]

ByteArrayDataBuilder

Builder for ByteArrayData instances.

Public Member Functions

Signature Returns Description Arguments

data(byte[] data)

ByteArrayDataBuilder

Sets the data

data

The data

build()

ByteArrayData

Builds the final immutable ByteArrayData instance.

DataBuilder

Base class for various builder implementation that builds Data instances <T>The type of data the builder is producing

ExecutionException

Execution exception can be thrown from an executor in order to capture execution exceptions. Note that you can throw any RuntimeException from the executor code but if you want to support retry attempts for an executor, you need to use the ExecutionException and provide retry information.

Since 2022-02-10

Public Constructors

To be able to load the class from the JS code, use this syntax:

const ExecutionException=Java.type('com.technia.tias.executor.api.ExecutionException');
let instance = new ExecutionException(... args ...);
Signature Description Arguments

ExecutionException()

Default constructor. The retry flag will not be set when this constructor is used.

ExecutionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)

Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used.

message

The detail message.

cause

The cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

enableSuppression

Whether suppression is enabled or disabled

writableStackTrace

Whether the stack trace should be writable

ExecutionException(String message)

Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used.

message

The detail message.

ExecutionException(Throwable cause)

Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used.

cause

The cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

ExecutionException(String message, Throwable cause)

Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used.

message

The detail message.

cause

The cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

ExecutionException(Throwable cause, boolean retryable, long retryDelay)

Constructs a new ExecutionException with the given data.

cause

The cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

retryable

True to support retry

retryDelay

The delay in milliseconds to wait before next retry takes place.

ExecutionException(String message, Throwable cause, boolean retryable, long retryDelay)

Constructs a new ExecutionException with the given data.

message

The detail message.

cause

The cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

retryable

True to support retry

retryDelay

The delay in milliseconds to wait before next retry takes place.

Public Member Functions

Signature Returns Description Arguments

isRetryable()

boolean

Returns true if the failure is of a kind that could be recovered at a later time by retrying the operation.

getRetryDelay()

long

Returns the minimum delay to wait until retrying again. The returned value is in milliseconds.

InMemoryData

This class is a subclass to com.technia.tias.executor.api.Data.

An in-memory representation of a Data instance. This instance is immutable

Since 2022-09-22

Public Constructors

To be able to load the class from the JS code, use this syntax:

const InMemoryData=Java.type('com.technia.tias.executor.api.InMemoryData');
let instance = new InMemoryData(... args ...);
Signature Description Arguments

InMemoryData(Data data)

Constructs a new instance from another Data instance.

data

The other instance to copy from. Not null.

InMemoryData(byte[] content, String contentType, Charset charset, String name, String description, DataType dataType)

Constructs a new immutable instance.

content

The data content

contentType

The content type of the data

charset

The charset for the data

name

The name associated with this data

description

An optional description for this data

dataType

The type of data.

Public Member Functions

Signature Returns Description Arguments

getName()

String

Returns the name of this data.

getType()

DataType

Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER.

getDescription()

String

Returns a description of the data.

getInputStream()

InputStream

Returns an inputstream that contains the bytes representing the data.

getContentType()

String

Returns the content type.

getContentEncoding()

String

Returns the content encoding.

getContentAsString()

String

Tries to convert the data into a String using the encoding as specified via the getContentEncoding() method. If that method returns null, UTF-8 is the assumed encoding to be used when converting the bytes into characters.

getSize()

long

Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used.

getBytes()

byte[]

Inherited Public Functions

Signature Returns Description Arguments

getName()

String

Returns the name of this data instance.

getType()

DataType

Returns the type for this data instance, if known.

getDescription()

String

Returns the description for this data instance, if known.

getInputStream()

InputStream

This method returns an InputStream from which you can read all the bytes of this data instance.

getContentType()

String

Returns the content type of the data, if known.

getContentEncoding()

String

Returns the content encoding if known.In most cases UTF8 will be used if this information is not provided and there is a need to convert bytes into characters or vice versa.

getContentAsString()

String

Tries to convert the data into a String using the encoding as specified via the getContentEncoding() method. If that method returns null, UTF-8 is the assumed encoding to be used when converting the bytes into characters.

getSize()

long

Returns the size of the data content if known. A negative value can be returned to indicate that the size is not known.

StringData

This class is a subclass to com.technia.tias.executor.api.InMemoryData.

Data implementation for String based data.

Since 2022-02-17

Public Constructors

To be able to load the class from the JS code, use this syntax:

const StringData=Java.type('com.technia.tias.executor.api.StringData');
let instance = new StringData(... args ...);
Signature Description Arguments

StringData(String data, String contentType, Charset charset, String name, String description, DataType dataType)

Constructs a new immutable StringData instance.

data

The data

contentType

The content type of the data

charset

The charset for the data

name

The name associated with this data

description

An optional description for this data

dataType

The type of data.

Public Static Functions

To be able to call a static method on a class from the JS code, use this syntax:

const StringData=Java.type('com.technia.tias.executor.api.StringData');
StringData.nameOfMethod(...)
Signature Returns Description Arguments

newBuilder()

StringDataBuilder

Returns a new builder instance.

Inherited Public Functions

Signature Returns Description Arguments

getName()

String

Returns the name of this data.

getType()

DataType

Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER.

getDescription()

String

Returns a description of the data.

getInputStream()

InputStream

Returns an inputstream that contains the bytes representing the data.

getContentType()

String

Returns the content type.

getContentEncoding()

String

Returns the content encoding.

getContentAsString()

String

Tries to convert the data into a String using the encoding as specified via the getContentEncoding() method. If that method returns null, UTF-8 is the assumed encoding to be used when converting the bytes into characters.

getSize()

long

Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used.

getBytes()

byte[]

StringDataBuilder

Builder for StringData instances.

Public Member Functions

Signature Returns Description Arguments

data(String data)

StringDataBuilder

Sets the data

data

The data

build()

StringData

Builds the final immutable StringData instance.