*/
private InstanceInfoDocument genInstanceInfoDocument(final Long iid) {
if (iid == null)
throw new InvalidRequestException("Must specifiy instance id.");
InstanceInfoDocument ret = InstanceInfoDocument.Factory.newInstance();
final TInstanceInfo ii = ret.addNewInstanceInfo();
ii.setIid(iid.toString());
dbexec(new BpelDatabase.Callable<Object>() {
public Object run(BpelDAOConnection conn) throws Exception {
ProcessInstanceDAO instance = conn.getInstance(iid);