CaseEvent

public class CaseEvent

Wrapper class for convenience when a MotechEvent representing a CaseEvent is received.

Constructors

CaseEvent

public CaseEvent(String caseId)

Creates an instance of the CaseEvent class with the given caseId.

Parameters:
  • caseId – the ID of the case to create

CaseEvent

public CaseEvent(MotechEvent event)

Creates an instance of the CaseEvent class based on the data passed as the given event parameters.

Parameters:
  • event – the event that stores data used for creating CaseEvent

Methods

fromCaseInfo

public static CaseEvent fromCaseInfo(CaseInfo caseInfo, String configName)

Creates an instance of the CaseEvent class based on the given caseInfo and configName.

Parameters:
  • caseInfo – the case information
  • configName – the configuration name
Returns:

an instance of the CaseEvent

fromCaseXml

public static CaseEvent fromCaseXml(CaseXml caseInstance, String configName)

Creates an instance of the CaseEvent class based on the given caseInstance and configName.

Parameters:
  • caseInstance – the case instance
  • configName – the configuration name
Returns:

an instance of the CaseEvent

getAction

public String getAction()

getApiKey

public String getApiKey()

getCaseDataXmlns

public String getCaseDataXmlns()

getCaseId

public String getCaseId()

getCaseName

public String getCaseName()

getCaseType

public String getCaseType()

getConfigName

public String getConfigName()

getDateModified

public String getDateModified()

getFieldValues

public Map<String, String> getFieldValues()

getOwnerId

public String getOwnerId()

getServerModifiedOn

public String getServerModifiedOn()

getUserId

public String getUserId()

setAction

public void setAction(String action)

setApiKey

public void setApiKey(String apiKey)

setCaseDataXmlns

public void setCaseDataXmlns(String caseDataXmlns)

setCaseId

public void setCaseId(String caseId)

setCaseName

public void setCaseName(String caseName)

setCaseType

public void setCaseType(String caseType)

setConfigName

public void setConfigName(String configName)

setDateModified

public void setDateModified(String dateModified)

setFieldValues

public void setFieldValues(Map<String, String> fieldValues)

setOwnerId

public void setOwnerId(String ownerId)

setServerModifiedOn

public void setServerModifiedOn(String serverModifiedOn)

setUserId

public void setUserId(String userId)

toMotechEventWithData

public MotechEvent toMotechEventWithData()

Creates an instance of the MotechEvent class based on this CaseEvent. All data stored by this CaseEvent will be included in the event as parameters.

Returns:an instance of the MotechEvent

toMotechEventWithoutData

public MotechEvent toMotechEventWithoutData()

Creates an instance of the MotechEvent class based on this CaseEvent. No data but case ID, custom parser event key, case type and configuration name will be included in the event as parameters.

Returns:an instance of the MotechEvent