* @param includeActivityInfo
* @return generated document
*/
private ScopeInfoDocument genScopeInfoDocument(final String siid, final boolean includeActivityInfo) {
if (siid == null)
throw new InvalidRequestException("Must specifiy scope instance id.");
final Long siidl;
try {
siidl = new Long(siid);
} catch (NumberFormatException nfe) {
throw new InvalidRequestException("Invalid scope instance id.");
}
ScopeInfoDocument ret = ScopeInfoDocument.Factory.newInstance();
final TScopeInfo ii = ret.addNewScopeInfo();
ii.setSiid(siid);
dbexec(new BpelDatabase.Callable<Object>() {
public Object run(BpelDAOConnection conn) throws Exception {
try {
ScopeDAO instance = conn.getScope(siidl);
if (instance == null)
throw new InvalidRequestException("Scope not found: " + siidl);
// TODO: deal with "ERROR" state information.
fillScopeInfo(ii, instance, includeActivityInfo);
} catch (Exception e) {
e.printStackTrace();
}