CaseActionService

public interface CaseActionService

This service is responsible for handling Commcare Case actions in tasks.

Methods

createCase

CaseTask createCase(String configName, String caseType, String ownerId, String caseName, Map<String, Object> fieldValues)

Creates a Commcare Case, by sending Case XML to the Submission API on the Commcare server.

Parameters:
  • configName – the name of the configuration used for connecting to CommcareHQ
  • caseType – the case type of case on CommCareHQ
  • ownerId – the ID of the owner
  • caseName – the case name of case on CommCareHQ
  • fieldValues – the params that will be passed to CommcareHQ with case information
Returns:

an object representing the case information and case actions submitted as case xml

updateCase

void updateCase(String configName, String caseId, String ownerId, Boolean closeCase, Map<String, Object> fieldValues)

Updates a Commcare Case, by sending Case XML to the Submission API on the Commcare server. The case ID is required to identify the case that is supposed to be updated

Parameters:
  • configName – the name of the configuration used for connecting to CommcareHQ
  • caseId – the id of the case on CommCareHQ
  • ownerId – the ID of the owner
  • closeCase – true to optionally close the case on CommCareHQ
  • fieldValues – the params that will be passed to CommcareHQ with case information