/** * Return a unique identifier for this workflow run. If the system * default LSID provider is set in DataThing.SYSTEM_DEFAULT_LSID_PROVIDER, * a fresh LSID will be assigned. Otherwise, a semi-unique string will * be generated from the internal engine representation. * */ public synchronized String getID() { if (instanceLSID == null && DataThing.SYSTEM_DEFAULT_LSID_PROVIDER != null) { // If there's a global LSID provider configured then use // it to get an LSID for the workflow instance class and // store it. LSIDProvider provider = DataThing.SYSTEM_DEFAULT_LSID_PROVIDER; instanceLSID = provider.getID(LSIDProvider.WFINSTANCE); } if (instanceLSID == null) { // Last resort, make up some kind of id return engine.toString() + engineId; } return instanceLSID; }
private void doInternalLSIDFill(Object o, LSIDProvider provider) { String lsidValue = lsid.get(o); if (lsidValue == null || lsidValue.equals("")) { if (o instanceof Collection) { lsid.put(o, provider.getID(LSIDProvider.DATATHINGCOLLECTION)); } else { lsid.put(o, provider.getID(LSIDProvider.DATATHINGLEAF)); } } if (o instanceof Collection) { Iterator i = ((Collection) o).iterator(); for (; i.hasNext();) { doInternalLSIDFill(i.next(), provider); } } else { // got to the leaf return; } }