KeyInformation

public final class KeyInformation

Object representation of dragged field from trigger or data source.

This class represents a single dragged field from trigger or data source. This class does not expose a public constructor. You have to use parse(String) method if you want to parse single field or parseAll(String) if you want ot get all fields from a given string.

Fields

ADDITIONAL_DATA_PREFIX

public static final String ADDITIONAL_DATA_PREFIX

Prefix which is used for data source fields.

POST_ACTION_PARAMETER_PREFIX

public static final String POST_ACTION_PARAMETER_PREFIX

Prefix which is used for post action parameters fields.

TRIGGER_PREFIX

public static final String TRIGGER_PREFIX

Prefix which is used for trigger fields.

Methods

equals

public boolean equals(Object obj)

fromAdditionalData

public boolean fromAdditionalData()

Check if the field is from the data source.

Returns:true if the field is from the data source otherwise false

fromPostActionParameter

public boolean fromPostActionParameter()

Check if the field is from the post action parameter.

Returns:true if the field is from the post action parameter otherwise false

fromTrigger

public boolean fromTrigger()

Check if the field is from the trigger.

Returns:true if the field is from the trigger otherwise false

getDataProviderName

public String getDataProviderName()

getKey

public String getKey()

getManipulations

public List<String> getManipulations()

Get manipulations assigned to the field.

Returns:list of manipulations

getObjectId

public Long getObjectId()

getObjectType

public String getObjectType()

getOriginalKey

public String getOriginalKey()

Get original representation of the dragged field.

Returns:string representation of the field

getPrefix

public String getPrefix()

hasManipulations

public boolean hasManipulations()

Check if the field has any manipulations.

Returns:true if the field has manipulations otherwise false

hashCode

public int hashCode()

parse

public static KeyInformation parse(String input)

Parse given string to instance of KeyInformation.

This method should be used to convert string representation of dragged field to instance of KeyInformation.

Argument has adhere to one of the following format:

  • trigger field format: trigger.eventKey
  • data source format: ad.dataProviderId.objectType#objectId.fieldKey
  • post action parameter format: pa.objectId.fieldKey

Argument can also contain list of manipulation which should be executed on field before it will be used by TaskTriggerHandler class. Manipulations should be connected together by the ? character.

Example of input argument:

  • ad.279f5fdf60700d9717270b1ae3011eb1.CaseInfo#0.fieldValues.phu_id
  • trigger.message?format(Ala,cat)?capitalize
Parameters:
  • input – string representation of a dragged field from trigger or data source
Throws:
  • IllegalArgumentException – exception is thrown if format for data source field is incorrect or if the dragged field is not from trigger or data source.
Returns:

Object representation of a dragged field

parseAll

public static List<KeyInformation> parseAll(String input)

Find all fields from given input and convert them to the instance of KeyInformation.

This method should be used to find and convert all of string representation of the field from trigger and/or data sources. Fields in input have to adhere to one of the following formats:

  • trigger field format: {{trigger.eventKey}}
  • data source format: {{ad.dataProviderId.objectType#objectId.fieldKey}}
  • post action parameter format: pa.fieldKey

To find fields in the input argument this method uses regular expression. When field is found it is converted to an instance of KeyInformation by using the parse(String) method.

Fields are found by the following regular expression: {{((.*?))(}})(?![^(]*)). The expression searches for strings that start with {{ and end with }} and are not within ( and ). Because of manipulations which contain additional data in (...) needed to execute manipulation on the field (e.g.: join needs to have the join character) and the text in (...) can be another string representation of the dragged field, the expression has to check if the field has this kind of manipulation.

Example of input argument:

  • {{trigger.message?format(Ala,cat)?capitalize}}
  • You get the following message: {{trigger.message}}
Parameters:
  • input – string with one or more string representation of dragged fields from trigger and/or data sources
Throws:
Returns:

list of object representation of dragged fields.