Return-Path: X-Original-To: apmail-oodt-dev-archive@www.apache.org Delivered-To: apmail-oodt-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 68513142A for ; Tue, 26 Apr 2011 11:48:00 +0000 (UTC) Received: (qmail 69366 invoked by uid 500); 26 Apr 2011 11:48:00 -0000 Delivered-To: apmail-oodt-dev-archive@oodt.apache.org Received: (qmail 69100 invoked by uid 500); 26 Apr 2011 11:47:59 -0000 Mailing-List: contact dev-help@oodt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oodt.apache.org Delivered-To: mailing list dev@oodt.apache.org Received: (qmail 68854 invoked by uid 99); 26 Apr 2011 11:47:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 11:47:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brbarkstrom@gmail.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bw0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 11:47:55 +0000 Received: by bwz14 with SMTP id 14so674027bwz.16 for ; Tue, 26 Apr 2011 04:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=1gO35jZCza2QsBV5RSkXEGqBvTE1KgoCIfounT0qyeQ=; b=ZVvr4UJE1u1+5sm2gSCfC5+S2Y46hCClgc44C2/Sy9dvqdCIf12taRD9aXcybR7TWR OAj5zEEwOZ7aONU+pAfPhO9ceJ8+aj7oiSaOssV/QcpPR8S/zd+T5XusciTVhj0WltC6 xpIs33Q6bA47lkS2NgXz23u708gzfmsDyMzdc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=O6kGEPhrZb+rkd6NiqukU/FTQOOjXvyEJSWduwD9Kt9EcpXq/xbFmKofRYWHJyXIWL x0kiP//AyaJB6zQM+120H491E2OtR/bb8W5O6+yJWInSQ33FtWnKOWNV0CB1Ubm0pc9m YHzdQHBzUFBVp7212l4F34ALj8ogcc/yQu7T8= MIME-Version: 1.0 Received: by 10.204.154.219 with SMTP id p27mr604206bkw.110.1303818453257; Tue, 26 Apr 2011 04:47:33 -0700 (PDT) Received: by 10.204.66.201 with HTTP; Tue, 26 Apr 2011 04:47:33 -0700 (PDT) In-Reply-To: <1F0AD604-9674-4422-B02C-2C38760B79E6@jpl.nasa.gov> References: <8EEF76C8-0BBB-49AA-A843-9641791502AD@jpl.nasa.gov> <19C76621-1819-4792-A6EF-B5418347E0BE@jpl.nasa.gov> <1F0AD604-9674-4422-B02C-2C38760B79E6@jpl.nasa.gov> Date: Tue, 26 Apr 2011 07:47:33 -0400 Message-ID: Subject: Re: Obtaining workflow instance unique ID From: Bruce Barkstrom To: dev@oodt.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable As an outside thought, you might want to think of a workflow as a kind of graph whose vertices are either processes or "files" (metadata perhaps being one kind of file - if you want to think of database transacti= ons as "files", you can add those to the category of "file"). The edges in the graph are events. Maybe you want to have an inventory of vertices or an inventory of edges. If you want to think about a hierarchical graph, that might be useful as well, although the data structure and access methods might be a bit more complex. If you want a graph (or collection of graphs - one graph per workflow), you might use hashing on the ID's to access either vertices or edges. Interesting problem. Bruce R. Barkstrom On Mon, Apr 25, 2011 at 11:00 PM, Verma, Rishi (317I) wrote: > Hi Paul, > > Thanks a lot for your suggestions. > > I agree, the second approach is probably the way to go. Although, would i= t be more beneficial to save and return a single 'event' ID instead of mult= iple workflow instance IDs? I'm under the assumption that workflow behaves = something akin to a job submission system. This assumption may be incorrect= , but it might be beneficial to just get back a single unique ID for the la= unch of a workflow top-level event as opposed to getting back a list of IDs= ... > > So perhaps within XmlRpcWorkflowManager.handleEvent, we could generate an= d save a unique ID for the single event? This ID could be queried by a clie= nt. > > Thanks! > rishi > > On Apr 25, 2011, at 1:25 PM, Ramirez, Paul M (388J) wrote: > >> Hey All, >> >> Thought this might be useful to the larger OODT community. >> >> >> >> Hey Rishi, >> >> I talked with Mike about this last week but never got back to him with a= concrete answer. However, after putting some more thought into it there ar= e 2 approaches I can think of. >> >> First Approach: >> 1) Put some type of user generated id in the metadata object that gets i= nto the workflow instance metadata >> 2) Page through the lists of workflow instances that the workflow manage= r has and identify those with your tag. Remember an event can kick off more= than one workflow. >> 3) Any that have metadata that match your user generated id are your wor= kflow instances you're interested in. >> >> Second Approach: >> 1) Add a new method to the client and server so that list of workflow in= stance ids is returned >> >> Looking at XmlRpcWorkflowManager.java >> >> >> =A0 =A0public boolean handleEvent(String eventName, Hashtable metadata) >> =A0 =A0 =A0 =A0 =A0 =A0throws RepositoryException, EngineException { >> =A0 =A0 =A0 =A0LOG.log(Level.INFO, "WorkflowManager:= Received event: " + eventName); >> >> =A0 =A0 =A0 =A0List workflows =3D null; >> >> =A0 =A0 =A0 =A0try { >> =A0 =A0 =A0 =A0 =A0 =A0workflows =3D repo.getWorkflowsForEvent(eventName= ); >> =A0 =A0 =A0 =A0} catch (Exception e) { >> =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >> =A0 =A0 =A0 =A0 =A0 =A0throw new RepositoryException( >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Exception getting workflows asso= ciated with event: " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ eventName + ": = Message: " + e.getMessage()); >> =A0 =A0 =A0 =A0} >> >> =A0 =A0 =A0 =A0if (workflows !=3D null) { >> =A0 =A0 =A0 =A0 =A0 =A0for (Iterator i =3D workflows.iterator(); i.hasNe= xt();) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Workflow w =3D (Workflow) i.next(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LOG.log(Level.INFO, "= WorkflowManager: Workflow " + w.getName() >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ " retrieved for event "= + eventName); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Metadata m =3D new Metadata(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m.addMetadata(metadata); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0try { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0engine.startWorkflow(w, m); // Th= is returns a workflow instance which has an id that could be saved and retu= rned >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} catch (Exception e) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw new EngineException( >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Engine exception= when starting workflow: " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+= w.getName() + ": Message: " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+= e.getMessage()); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0 =A0return true; >> =A0 =A0 =A0 =A0} else >> =A0 =A0 =A0 =A0 =A0 =A0return false; >> =A0 =A0} >> >> This should probably be a new method on both the client and server and s= hould be supplied as a patch. The method would return either List o= r List probably the latter but maybe someone else will ch= ime in. Of course this would have to have the accompanying client method bu= t it shouldn't be that big of an update. >> >> My instincts would say that second approach is probably the way to go. >> >> >> Thanks, >> >> Paul >> >> >> >> On Apr 25, 2011, at 11:39 AM, Verma, Rishi (317I) wrote: >> >> >> =A0 return ((Boolean) client >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.execute("workflowmgr.handleEvent= ", argList)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.booleanValue(); >> >> Is there a way to obtain and query for a workflow 'instance ID'? >> >> Thanks! >> Rishi & Mike >> >> > >