Handling Process Variable

During the modeling process it will happen to have the necessity of checking a variable value, RC variables is the sharpest example, or to access variable values when a variable is not a plain String but a "Complex" type with methods (i.e. FileDetail variable type when triggering an instance with NewFile trigger).

Process variables are persisted entities that will live inside any process instance identified by a name and a value.

Whenever a process instance starts, required variable requested in contract creation come to life being assigned with their value, all the variables declared in any single service task, will come to life during the execution, when it will hit that very service task and it will be executed without errors.

The way to get a variable value is to surround it with ${variableName}, if it is a plain variable, if it is a complex object like one, described here: Process Variable Objects. It will contain multiple values that can be accessed by the relative getter method: i.e. ${file.getRegistryId()}.

If we need to check a variable value, in the case of an exclusive gateway, the condition has to be inside the parenthesis; ${variableValue == 0} or ${file.getRegistryId() == 12}.

Process Variable Objects

These are variables of type "Object" that can be found inside a process instance.
The user modeling a process won't be able to access a variable value just by its name, that is what happens with non-object variables:

i.e. ${myCustomVariable}

but since those are actually objects, there are methods providing access to the object's internal desired value:

i.e. ${myCustomVariable.getVariableValue()}

FileDetail

FileDetails is a Java Object returned from New File Event and available as predefined variable --> file.

ParameterTypeFunction to retrieve the resultDescription
registryIdLonggetRegistryId()The Id Fileset inserted in the Databox (ex: ${file.getRegistryId()})
clusterNameStringgetClusterName()The Cluster name where the file has been received (ex: ${file.getClusterName()})
virtualPathStringgetVirtualPath()The Databox (Virtual Path) where the file has been inserted. The format is vfsName:vfsPath (ex: ${file.getVirtualPath()})
Sample value:
epoLAB-vfs-unsigned:/eMail_attachment
nameStringgetName()The Original File Name (ex: ${file.getName()})
virtualFolderStringgetVirtualFolder()The Databox Folder where the file has been inserted. The format is vfsPath (ex: ${file.getVirtualPath()})
Sample value:
/eMail_attachment
virtualFsStringgetVirtualFS()The Databox FileSystem name where the file has been inserted. The format is vfsName (ex: ${file.getVirtualFS()})
Sample value:
epoLAB-vfs-unsigned
extensionStringgetExtension()File extension
nameNoExtensionStringgetNameNoExtension()File name without extension
absoluteFileNameStringgetAbsoluteFileName()The absolute file name of the file (ex: ${file.getAbsoluteFileName()})
metadataStringgetMetadataValue(String key)Get a file metadata value by key
metadataList <String>getMetadatakeys()Get file metadata values (list of values)
NOTE: available only when the ${file} variable is created by an Incoming Update Metadata Event.

ExternalFile

ExternalFile is a Java Object returned by service tasks of types: Spls, DataboxSpls, RemoteSpls, VirtualBox LS. Each brick returns a variable --> fileList that is a List. In the following examples we assume that the current element of the list is refernced as --> currentFile.

ParameterTypeFunction to retrieve the resultDescription
fileIdLonggetFileId()The Id Fileset inserted in the Databox (ex: ${currentFile.getFileId()}). This is available only from DataboxSpls that lists files in a Databox, otherwise is NULL
sizeLonggetSize()The size file attribute provided by the subsystem that created this entry
dateModifiedDategetDatemodified()The date of the last file modification
directoryBooleangetDirectory()If true the file is a Directory (ex: ${currentFile.getDirectory()})
filePathStringgetFilePath()The full path of the file (ex: ${currentFile .getFilePath()})
fileNameStringgetFileName()File Name (ex: ${currentFile.getFileName()})
fileNameNoExtensionStringgetFileNameNoExtension()File Name only without extension (ex: ${currentFile.getFileNameNoExtension()})
sizeLonggetSize()The size of the file (ex: ${currentFile.getFileSize()})

Properties

Properties is a Java Object returned from Command Server bricks: Spprop. The return variable is --> property and is a Map<String, String> read from a property file.

ParameterTypeFunction to retrieve the resultDescription
valueStringgetProperty(key)Get the value of the property with Key=key (ex: ${property.getProperty("MyKey")})

GBIFlowInput

GBIFlowInput is a Java Object that contains all parameters required to start a new GBI Process.

ParameterTypeFunction to retrieve the resultDescription
flowIdStringgetFlowId()The GBI Flow Identifier
parametersMap<String, String>getParameters()Map of all Input Parameters required by GBI Flow
correlationIdStringgetCorrelationId()System generated correlationId to be used as input in Camunda object that waits for GBI Flow termination

GBIFlowOutput

GBIFlowOutput is a Java Object that contains all parameters returned from GBI Process.

ParameterTypeFunction to retrieve the resultDescription
outcomeStringgetOutcome()The GBI Flow return code
parametersMap<String, String>getParameters()Map of all Output Parameters returned by GBI Flow
correlationIdStringgetCorrelationId()System generated correlationId used for process correlation