From uima-user-return-447-apmail-incubator-uima-user-archive=incubator.apache.org@incubator.apache.org Fri Aug 10 13:23:31 2007 Return-Path: Delivered-To: apmail-incubator-uima-user-archive@locus.apache.org Received: (qmail 93666 invoked from network); 10 Aug 2007 13:23:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Aug 2007 13:23:31 -0000 Received: (qmail 28709 invoked by uid 500); 10 Aug 2007 13:23:30 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 28600 invoked by uid 500); 10 Aug 2007 13:23:29 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 28591 invoked by uid 99); 10 Aug 2007 13:23:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 06:23:29 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lally.adam@gmail.com designates 64.233.166.177 as permitted sender) Received: from [64.233.166.177] (HELO py-out-1112.google.com) (64.233.166.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 13:23:25 +0000 Received: by py-out-1112.google.com with SMTP id d32so1662245pye for ; Fri, 10 Aug 2007 06:23:04 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HQ4fQjy4YC2MadmabsVddcph0CVzWBiLPyxylU1rUu3U6dsAIzm62ttEeY6RxYVK4BV6yEI/7bm0Zlr+2BJ2BfhAoeeDjMOMHrkKxpATH6Q8pb1JGPKJ8TuvPPqMYKMEqdEi0N5y0M105bVXvEOmlAPmG3+fCTMUSlaZrJ8BjXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=DrT3J0L3v1Fnl9bsd1gF6CBINZd38QP2VR0mAryplbzHyzfl8vrinXmpAHEWFE0GRtIhqRqvMO3txz2/OX4AcKSkoXTGuuthuwRIrzMWyMIQOWDgkbn9hCy6oFrkMBxuu+UEI1j2lwJUsxPLt8+dQt91K2CbGJsu6wadMaK6oxI= Received: by 10.35.70.17 with SMTP id x17mr5094593pyk.1186752184401; Fri, 10 Aug 2007 06:23:04 -0700 (PDT) Received: by 10.35.84.20 with HTTP; Fri, 10 Aug 2007 06:23:04 -0700 (PDT) Message-ID: <2787e08a0708100623n439f55d7t416940d5bcf49251@mail.gmail.com> Date: Fri, 10 Aug 2007 09:23:04 -0400 From: "Adam Lally" Sender: lally.adam@gmail.com To: uima-user@incubator.apache.org Subject: Re: conditional FlowController In-Reply-To: <46BC5FC9.4000501@igbmc.u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46BC5FC9.4000501@igbmc.u-strasbg.fr> X-Google-Sender-Auth: 2037fd6efee0b31c X-Virus-Checked: Checked by ClamAV on apache.org Hi Sophie, On 8/10/07, candel wrote: > Hello, > I am working on a UIMA FlowController. > I would like to guide a CAS through one or another AE depending on the > result of a first AE. > I think I have to write something like that: > > //running first AE > return SimpleStep(aeKey1); > //testing my condition > If (result=="ok"){ return new SimpleStep(aeKey2)} > Else { return new SimpleStep(aeKey3)} > //closing flow > return FinalStep(); > Sort of... but you can only return one Step object per call to the next() method, so you have to remember where you are in the flow. A simple way to do this would be like this: if (!firstAeCalled) { //running first AE firstAeCalled = true; return SimpleStep(aeKey1); } else if (!secondAeCalled) { secondAeCalled = true //TODO: compute "result" by looking at the CAS If (result=="ok"){ return new SimpleStep(aeKey2)} Else { return new SimpleStep(aeKey3)} } else { //closing flow return FinalStep(); } Also look at the exampleWhiteboardFlowController.java, which keeps a history of which AEs have been already called during the Flow. > The trouble is that I can't find out how to get the aeKey of a > particular AE...Is it simply the key name given in the AAE descriptor > where we join our own defined flow? > Yes, the aeKey will be the same as the key defined in the Aggregate Analysis Engine descriptor, but it's preferable to query the framework for this information rather than hard-coding a particular key value into your Flow Controller. In your FlowController, call: getContext().getAnalysisEngineMetaDataMap() This returns you a Map from aeKey Strings to AnalysisEngineMetaData object. The AnalysisEngineMetaData contains information from that particular delegate (component) AE's descriptor - such as its name, inputs,outputs, etc. Regards, -Adam