Shark shark = Shark.getInstance();
AdminMisc admin = shark.getAdminMisc();
WMSessionHandle sessionHandle = sc.getSessionHandle();
PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
WMEntity processEntity = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
WMEntity packageEntity = pa.getPackageEntity(sessionHandle, processEntity.getPkgId(), processEntity.getPkgVer());
XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
// get package variables
WMFilter vfilter = new WMFilter("Type", WMFilter.EQ, "DataField");
vfilter.setFilterType(XPDLBrowser.SIMPLE_TYPE_XPDL);
WMEntityIterator ei = xpdlBrowser.listEntities(sessionHandle, packageEntity, vfilter, true);
WMEntity[] variables = ei.getArray();
for (int i = 0; i < variables.length; i++) {
WMEntity entity = variables[i];
WorkflowVariable wv = new WorkflowVariable();
wv.setId(entity.getId());
wv.setName(entity.getName());
wv.setPackageLevel(true);
variableList.add(wv);
}
// get process variables
WMEntityIterator ei2 = xpdlBrowser.listEntities(sessionHandle, processEntity, vfilter, true);
WMEntity[] variables2 = ei2.getArray();
for (int i = 0; i < variables2.length; i++) {
WMEntity entity = variables2[i];
WorkflowVariable wv = new WorkflowVariable();
wv.setId(entity.getId());
wv.setName(entity.getName());
wv.setPackageLevel(false);
variableList.add(wv);
}
} catch (Exception ex) {