org.camunda.bpm.engine.impl.cmmn
Class CaseServiceImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.ServiceImpl
      extended by org.camunda.bpm.engine.impl.cmmn.CaseServiceImpl
All Implemented Interfaces:
CaseService

public class CaseServiceImpl
extends ServiceImpl
implements CaseService

Author:
Roman Smirnov

Field Summary
 
Fields inherited from class org.camunda.bpm.engine.impl.ServiceImpl
commandExecutor
 
Constructor Summary
CaseServiceImpl()
           
 
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.
 CaseSentryPartQuery createCaseSentryPartQuery()
          Creates a new CaseSentryPartQuery instance, that can be used to query the sentry parts.
 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.
 
Methods inherited from class org.camunda.bpm.engine.impl.ServiceImpl
getCommandExecutor, setCommandExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaseServiceImpl

public CaseServiceImpl()
Method Detail

withCaseDefinitionByKey

public CaseInstanceBuilder withCaseDefinitionByKey(String caseDefinitionKey)
Description copied from interface: CaseService

Define a CaseInstance using a fluent builder.

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

Specified by:
withCaseDefinitionByKey in interface CaseService
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

public CaseInstanceBuilder withCaseDefinition(String caseDefinitionId)
Description copied from interface: CaseService

Define a CaseInstance using a fluent builder.

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

Specified by:
withCaseDefinition in interface CaseService
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

public CaseInstanceQuery createCaseInstanceQuery()
Description copied from interface: CaseService

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

Specified by:
createCaseInstanceQuery in interface CaseService

createCaseExecutionQuery

public CaseExecutionQuery createCaseExecutionQuery()
Description copied from interface: CaseService

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

Specified by:
createCaseExecutionQuery in interface CaseService

createCaseSentryPartQuery

public CaseSentryPartQuery createCaseSentryPartQuery()
Description copied from interface: CaseService

Creates a new CaseSentryPartQuery instance, that can be used to query the sentry parts.

Specified by:
createCaseSentryPartQuery in interface CaseService

withCaseExecution

public CaseExecutionCommandBuilder withCaseExecution(String caseExecutionId)
Description copied from interface: CaseService

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

Specified by:
withCaseExecution in interface CaseService
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

public Map<String,Object> getVariables(String caseExecutionId)
Description copied from interface: CaseService

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 CaseService.getVariables(String, Collection) for better performance.

Specified by:
getVariables in interface CaseService
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

getVariablesLocal

public Map<String,Object> getVariablesLocal(String caseExecutionId)
Description copied from interface: CaseService

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 CaseService.getVariablesLocal(String, Collection) for better performance.

Specified by:
getVariablesLocal in interface CaseService
Parameters:
caseExecutionId - the id of a case execution, cannot be null
Returns:
the variables or an empty map if no such variables are found

getVariables

public Map<String,Object> getVariables(String caseExecutionId,
                                       Collection<String> variableNames)
Description copied from interface: CaseService

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

Specified by:
getVariables in interface CaseService
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

getVariablesLocal

public Map<String,Object> getVariablesLocal(String caseExecutionId,
                                            Collection<String> variableNames)
Description copied from interface: CaseService

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

Specified by:
getVariablesLocal in interface CaseService
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

getVariable

public Object getVariable(String caseExecutionId,
                          String variableName)
Description copied from interface: CaseService

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.

Specified by:
getVariable in interface CaseService
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

getVariableLocal

public Object getVariableLocal(String caseExecutionId,
                               String variableName)
Description copied from interface: CaseService

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.

Specified by:
getVariableLocal in interface CaseService
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


Copyright © 2014 camunda services GmbH. All Rights Reserved.