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());