Package org.jbpm.casemgmt.impl.generator
Class NoneCaseIdGenerator
- java.lang.Object
-
- org.jbpm.casemgmt.impl.generator.NoneCaseIdGenerator
-
- All Implemented Interfaces:
CaseIdGenerator
public class NoneCaseIdGenerator extends Object implements CaseIdGenerator
Generator that in general does not generate but rely on given case ids. By default it expects to have "CaseId" parameter given that represents case id. The name of the property can be changed by system property:
org.jbpm.cases.generator.caseid.param
-
-
Constructor Summary
Constructors Constructor Description NoneCaseIdGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringgenerate(String prefix, Map<String,Object> optionalParameters)Generates next value for given prefix.StringgetIdentifier()Identifier of the generator so it can be found and registered at runtimevoidregister(String prefix)Should be called only one time per given prefix.voidunregister(String prefix)Unregisters given prefix from the generator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jbpm.casemgmt.api.generator.CaseIdGenerator
resolveCaseIdPrefix
-
-
-
-
Method Detail
-
register
public void register(String prefix)
Description copied from interface:CaseIdGeneratorShould be called only one time per given prefix. Subsequent calls with same prefix do not affect the generator state.- Specified by:
registerin interfaceCaseIdGenerator- Parameters:
prefix- unique prefix that should be used for generating case identifiers
-
unregister
public void unregister(String prefix)
Description copied from interface:CaseIdGeneratorUnregisters given prefix from the generator. It's up to generator implementation to either remove the prefix and its latest value permanently or resume it in case of further registration of the same prefix.- Specified by:
unregisterin interfaceCaseIdGenerator- Parameters:
prefix- unique prefix that should be used for generating case identifiers
-
generate
public String generate(String prefix, Map<String,Object> optionalParameters) throws CasePrefixNotFoundException
Description copied from interface:CaseIdGeneratorGenerates next value for given prefix. Returned value should include the prefix as part of the returned value.- Specified by:
generatein interfaceCaseIdGenerator- Parameters:
prefix- unique prefix that should be used for generating case identifiersoptionalParameters- map of optionalParameters that might be helpful for implementation- Returns:
- complete case id in format (PREFIX-GENERATED_VALUE)
- Throws:
CasePrefixNotFoundException- in case given prefix was not registered
-
getIdentifier
public String getIdentifier()
Description copied from interface:CaseIdGeneratorIdentifier of the generator so it can be found and registered at runtime- Specified by:
getIdentifierin interfaceCaseIdGenerator- Returns:
- unique identifier
-
-