Hi Gregory,

On 1/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Considering that I have a couple of existing Agent implementations and
some time constraints, could anyone confirm this would be a correct way
of reusing them ?

        engine.registerParticipant(new
AbstractEmbeddedParticipant("my-agent") {
            public void consume(WorkItem wi) throws Exception {
                final Agent agent = agentBuilder.build("my-agent",
MyAgent.class.getName(), engine.getContext(), Collections.emptyMap());
                final InFlowWorkItem agentResult =
agent.use((InFlowWorkItem) wi);
                engine.reply(agentResult);
            }
        });

I would directly paste the agent's code within the consume method of
the embedded participant, it makes things way easier, less code.

Is there any side-effect (wanted or unwanted) in using the same name
for the participant and the agent ?

Forget the agent, you've got an embedded participant now.

How about the __agent_result__ ? I guess I'd need to implement its
handling if needed in the consume method of my participant ?

If your process definition uses the value of that field, then make
sure it's set in the embedded participant. You could maybe go for a
new field name if that makes things clearer. Don't be afraid to get
into control and wipe away old cruft.


Best regards,

--
John Mettraux   -///-   http://jmettraux.openwfe.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "OpenWFE 
users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwfe-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to