org.camunda.bpm.engine
Interface CaseService

All Known Implementing Classes:
CaseServiceImpl

public interface CaseService

Service which provides access to case instances and case executions.

Author:
Roman Smirnov

Method Summary
 CaseExecutionQuery createCaseExecutionQuery()
          Creates a new CaseExecutionQuery instance, that can be used to query the executions and case instances.
 CaseInstanceQuery createCaseInstanceQuery()
          Creates a new CaseInstanceQuery instance, that can be used to query case instances.
 Object getVariable(String caseExecutionId, String variableName)
          Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).
 Object getVariableLocal(String caseExecutionId, String variableName)
          The variable value for an case execution.
 Map<String,Object> getVariables(String caseExecutionId)
          All variables visible from the given execution scope (including parent scopes).
 Map<String,Object> getVariables(String caseExecutionId, Collection<String> variableNames)
          The variable values for all given variableNames, takes all variables into account which are visible from the given case execution scope (including parent scopes).
 Map<String,Object> getVariablesLocal(String caseExecutionId)
          All variable values that are defined in the case execution scope, without taking outer scopes into account.
 Map<String,Object> getVariablesLocal(String caseExecutionId, Collection<String> variableNames)
          The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.
 CaseInstanceBuilder withCaseDefinition(String caseDefinitionId)
          Define a CaseInstance using a fluent builder.
 CaseInstanceBuilder withCaseDefinitionByKey(String caseDefinitionKey)
          Define a CaseInstance using a fluent builder.
 CaseExecutionCommandBuilder withCaseExecution(String caseExecutionId)
          Define a command to be executed for a CaseExecution using a fluent builder.
 

Method Detail

withCaseDefinitionByKey

CaseInstanceBuilder withCaseDefinitionByKey(String caseDefinitionKey)

Define a CaseInstance using a fluent builder.

Starts a new case instance with the latest version of the corresponding case definition.

Parameters:
caseDefinitionKey - the key of a case definition to create a new case instance of, cannot be null
Returns:
a fluent builder for defining a new case instance

withCaseDefinition

CaseInstanceBuilder withCaseDefinition(String caseDefinitionId)

Define a CaseInstance using a fluent builder.

Starts a new case instance with the case definition version corresponding to the given id.

Parameters:
caseDefinitionId - the id of a case definition to create a new case instance, cannot be null
Returns:
a fluent builder for defining a new case instance

createCaseInstanceQuery

CaseInstanceQuery createCaseInstanceQuery()

Creates a new CaseInstanceQuery instance, that can be used to query case instances.


createCaseExecutionQuery

CaseExecutionQuery createCaseExecutionQuery()

Creates a new CaseExecutionQuery instance, that can be used to query the executions and case instances.


withCaseExecution

CaseExecutionCommandBuilder withCaseExecution(String caseExecutionId)

Define a command to be executed for a CaseExecution using a fluent builder.

Parameters:
caseExecutionId - the id of a case execution to define a command for it
Returns:
a fluent builder for defining a command for a case execution

getVariables

Map<String,Object> getVariables(String caseExecutionId)

All variables visible from the given execution scope (including parent scopes).

If you have many local variables and you only need a few, consider using getVariables(String, Collection) for better performance.

Parameters:
caseExecutionId - the id of a case instance or case execution, cannot be null
Returns:
the variables or an empty map if no such variables are found
Throws:
ProcessEngineException - when no case execution is found for the given case execution id

getVariablesLocal

Map<String,Object> getVariablesLocal(String caseExecutionId)

All variable values that are defined in the case execution scope, without taking outer scopes into account.

If you have many local variables and you only need a few, consider using getVariablesLocal(String, Collection) for better performance.

Parameters:
caseExecutionId - the id of a case execution, cannot be null
Returns:
the variables or an empty map if no such variables are found
Throws:
ProcessEngineException - when no case execution is found for the given case execution id

getVariables

Map<String,Object> getVariables(String caseExecutionId,
                                Collection<String> variableNames)

The variable values for all given variableNames, takes all variables into account which are visible from the given case execution scope (including parent scopes).

Parameters:
caseExecutionId - the id of a case instance or case execution, cannot be null
variableNames - the collection of variable names that should be retrieved
Returns:
the variables or an empty map if no such variables are found
Throws:
ProcessEngineException - when no case execution is found for the given case execution id

getVariablesLocal

Map<String,Object> getVariablesLocal(String caseExecutionId,
                                     Collection<String> variableNames)

The variable values for the given variableNames only taking the given case execution scope into account, not looking in outer scopes.

Parameters:
caseExecutionId - the id of a case execution, cannot be null
variableNames - the collection of variable names that should be retrieved
Returns:
the variables or an empty map if no such variables are found
Throws:
ProcessEngineException - when no case execution is found for the given case execution id

getVariable

Object getVariable(String caseExecutionId,
                   String variableName)

Searching for the variable is done in all scopes that are visible to the given case execution (including parent scopes).

Returns null when no variable value is found with the given name or when the value is set to null.

Parameters:
caseExecutionId - the id of a case instance or case execution, cannot be null
variableName - the name of a variable, cannot be null
Returns:
the variable value or null if the variable is undefined or the value of the variable is null
Throws:
ProcessEngineException - when no case execution is found for the given case execution id

getVariableLocal

Object getVariableLocal(String caseExecutionId,
                        String variableName)

The variable value for an case execution. Returns the value when the variable is set for the case execution (and not searching parent scopes).

Returns null when no variable value is found with the given name or when the value is set to null.

Parameters:
caseExecutionId - the id of a case instance or case execution, cannot be null
variableName - the name of a variable, cannot be null
Returns:
the variable value or null if the variable is undefined or the value of the variable is null
Throws:
ProcessEngineException - when no case execution is found for the given case execution id


Copyright © 2014 camunda services GmbH. All Rights Reserved.