10-03-2011 10:32 AM
public void execute(DelegateExecution execution) throws Exception {
execution.setVariable("firstResultIterator", this.firstResultIterator);
}
org.activiti.engine.ActivitiException: couldn't find type for net.atos.wlp.tool.archive.batch.FirstResultIterator@1f9cdda
at org.activiti.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:212)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:164)
at net.atos.wlp.tool.archiving.ArchiveMI.execute(ArchiveMI.java:36)
package net.atos.wlp.tool.archive.batch;
import java.util.Iterator;
public class FirstResultIterator implements Iterable<Integer>, Iterator<Integer> {
private static final Logger logger = Logger.getLogger(FirstResultIterator.class);
private int batchSize = 0;
private int defaultBatchSize = 50; //SPOPV-4381
int startNumber = 0;
private AtomicBoolean hasNext = new AtomicBoolean(true);
public Iterator<Integer> iterator() {
return this;
}
public boolean hasNext() {
return hasNext.get();
}
public Integer next() {
int result = startNumber;
startNumber += batchSize;
return result;
}
public void remove() {
throw new UnsupportedOperationException("remove");
}
/**
* @param hasNext
* the hasNext to set
*/
public void setHasNext(boolean hasNext) {
this.hasNext.set(hasNext);
}
/**
* @return the bATCH_SIZE
*/
public int getBatchSize() {
return batchSize;
}
/**
* @param size
* the bATCH_SIZE to set
*/
public void setBatchSize(int size) {
if (size > 0)
batchSize = size;
else
batchSize=defaultBatchSize;
if (logger.isInfoEnabled())
logger.info("BatchSize set to:" + batchSize);
}
public void setDefaultBatchSize(int size) {
if (size > 0)
defaultBatchSize = 50; //SPOPV-4381
if (logger.isInfoEnabled())
logger.info("defaultBatchSize set to:" + defaultBatchSize);
}
}
10-03-2011 11:23 AM
When you use a Java bean as a process variable make sure the bean implements the Serializable interface, because the process variable will be persisted to the Activiti engine database.
10-03-2011 12:38 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.