/** * {@inheritDoc} */ public ActivityUnit getActivityUnit(final String id) throws Exception { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Get Activity Unit=" + id); } ActivityUnit ret = _jpaStore.withJpa(new JpaWork<ActivityUnit>() { public ActivityUnit perform(Session s) { return (ActivityUnit) s.createQuery( "SELECT au FROM ActivityUnit au WHERE au.id = '" + id + "'").uniqueResult(); } }); if (LOG.isLoggable(Level.FINEST)) { LOG.finest("ActivityUnit id=" + id + " Result=" + new String(ActivityUtil.serializeActivityUnit(ret))); } return (ret); }
/** * This method processes the supplied activity unit to derive * service definition information. * * @param actUnit The activity unit * @return The service definitions */ public static java.util.Collection<ServiceDefinition> derive(ActivityUnit actUnit) { java.util.Map<String,ServiceDefinition> ret= new java.util.HashMap<String,ServiceDefinition>(); checkForServiceInvoked(ret, actUnit, 0, actUnit.getActivityTypes().size(), null); if (LOG.isLoggable(Level.FINEST)) { String au=null; try { au = new String(ActivityUtil.serializeActivityUnit(actUnit)); } catch (Exception e) { LOG.log(Level.FINEST, "Failed to deserialize activity unit: "+actUnit, e); } LOG.finest("Derive service definitions: ActivityUnit="+au+" ServiceDefinitions="+ret); } return (ret.values()); }
byte[] b=ActivityUtil.serializeActivityUnit(au);