JavaScript Object methods for the case and event objects
The case object, aCase
, is the parameter that you pass in the caseMetric
function. You can invoke the object methods in 'Table 1. Object methods' on aCase
to compute the user-defined results:
Object methods | Data type | Description |
---|---|---|
getCaseId() |
string |
Returns the case-id value that is associated to current case |
getCaseIdIndex() |
integer |
Returns a dictionary index of case-id value associated to current case |
get( <index> ) |
CaseEvent |
Returns the event object at the specified index in the case sequence |
size() |
long |
Returns the number of events in the current case |
Table 1. aCase
object methods
You can invoke the object methods in 'Table 2. The event object methods' to compute results for the case event object.
Object methods | Data type | Description |
---|---|---|
getCaseId() |
string |
Returns the case-id value that is associated to the current case. |
getCaseIdIndex() |
integer |
Returns the dictionary index of the case-id value that is associated to the current case. |
getSecondaryCaseId() |
string |
Returns the second mapped business entity ID value that is associated to the current case. |
getSecondaryCaseIdIndex() |
integer |
Returns the dictionary index of the second mapped business entity ID value that is associated to the current case. |
getTertiaryCaseId() |
string |
Returns the third mapped business entity ID value that is associated to the current case. |
getTertiaryCaseIdIndex() |
integer |
Returns the dictionary index of the third mapped business entity ID value that is associated to the current case. |
getFourthCaseId() |
string |
Returns the fourth mapped business entity ID value that is associated to the current case. |
getFourthCaseIdIndex() |
integer |
Returns the dictionary index of the fourth mapped business entity ID value that is associated to the current case. |
getFifthCaseId() |
string |
Returns the fifth mapped business entity ID value that is associated to the current case. |
getFifthCaseIdIndex() |
integer |
Returns the dictionary index of the fifth mapped business entity ID value that is associated to the current case. |
getEventClass() |
string |
Returns the class of a case event (activity). This method also considers the alias of an activity. |
getEventClassBase() |
string |
Returns the class of a case event (activity). This method does not consider alias. |
getStartTime() |
long |
Returns the start time in milliseconds (UNIX timestamp) of the current event. |
getEndTime() |
long |
Returns the end time in milliseconds (UNIX timestamp) of the current event. |
getResource() |
string |
Returns the associated resource of a case event, that is, the resource that is running the activity. |
getRole() |
string |
Returns the role of a case event, that is, the role that is running the activity. |
getWorkingTime() |
long |
Returns a long value that represent the working time for each activity in milliseconds. |
getStringCustomAttributeValue( <fieldId> ) |
string |
Returns a string value that is mapped in the event log to the corresponding fieldId (the name of the mapped custom column) of the current event. For example, you can use the method, getStringCustomAttributeValue("Opportunity_Customer") to retrieve the event value of a field with the column name as Opportunity_Customer and mapped as string . |
getIntCustomAttributeValue( <fieldId> ) |
integer |
Returns an integer value that is mapped in the event log to the corresponding fieldId (the name of the mapped custom column) of the current event. For example, you can use the method, getIntCustomAttributeValue("Opportunity_Class") to retrieve the event value of a field with the column name as Opportunity_Class and mapped as Integer . |
getLongCustomAttributeValue( <fieldId> ) |
long |
Returns a long value that is mapped in the event log to the corresponding fieldId (the name of the mapped custom column) of the current event. For example, you can use the method, getLongCustomAttributeValue("Opportunity_CloseDate") to retrieve the event value of a field with the column name as Opportunity_CloseDate and mapped as Date . |
getDoubleCustomAttributeValue( <fieldId> )` |
double |
Returns a double value that is mapped in the event log to the corresponding fieldId (the name of the mapped custom column) of the current event. For example, you can use the method, getStringCustomAttributeValue("Opportunity_Amount") to retrieve the event value of a field with a column name Opportunity_Amount and mapped as numeric . |
getDiscarded() |
boolean |
Returns true if the current event discards the combination of applied filters. |
getSimulation() |
short |
Returns 1 if the event belongs to a simulated data source. |
getConformant() |
short |
Returns 1 if the event belongs to a case without deviations from the reference model. Before you use this method, you must ensure to upload the
reference model. |
Table 2. The event object methods