HomeGuides
Log In
Guides

Handling Process Variable

When modeling a process, it may be necessary to check the value of a variable (RC variables are the most obvious example) or to access the values of a variable if it is not a simple string but a complex type with methods (e.g. the FileDetail variable type when activating an instance with the NewFile trigger).

Process variables are persistent entities that live within each process instance, identified by a name and a value.

Each time a process instance is started, the variables required to create the contract are activated and assigned their value. Any variables declared in each service task are activated during execution when that particular service task is encountered and executed without error.

The way to get the value of a simple variable is to enclose it in ${variableName}. If it is a complex variable like the one described in Process Variable Objects, it will contain multiple values that can be accessed with its getter method: e.g. ${file.getRegistryId()}.

If the value of a variable is to be checked, in the case of an exclusive gateway, the condition must be between brackets: ${variableValue == 0} or [${file.getRegistryId() == 12}].

Process Variable Objects

These are variables of type "Object" that can be found in 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:

${myCustomVariable}

but since those are 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 the New File Event and available as a 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 the following types: Spls, DataboxSpls, RemoteSpls, and 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 referenced 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.

ParameterFunction to retrieve the resultTypeDescription
outcomegetOutcome()StringThe GBI Flow return code
parametersgetParameters()Map<String, String>Map of all Output Parameters returned by GBI Flow
correlationIdgetCorrelationId()StringSystem generated correlationId used for process correlation