Base64

Attributes

URI:http://www.xmlpipe.org/xpe/agent/filter/agent
Type:filter
Namespace:http://www.xmlpipe.org/xpe/agent
Owner:http://www.xmlpipe.org/xpe/agent

Description

This filter instructs an agent to invoke services automatically.

Update an agent


   <a:update  name="{agent name}"  type="{agent type}"  targetUri="URI of the service to invoke"  xmlns:a="http://www.xmlpipe.org/xpe/agent" />

The above request creates an instance of an agent of the given type specified by the type attribute. If an agent with the given name already exists, it will just updates the instance by tring to start the agent again if it is currently stopped. Depending on the type of agent, it will send a request to the target URI by either GET or POST.

Stop a service


   <a:stop  name="{agent name}"  xmlns:a="http://www.xmlpipe.org/xpe/agent" />

The above request will instruct the agent to stop as soon as it finishes its current task. This is the preferred way to stop an agent.

Kill a service


   <a:kill  name="{agent name}"  xmlns:a="http://www.xmlpipe.org/xpe/agent" />

The above request will try to interrupt the agent and make it stop.

Agent: Invoker

The agent is created when the type attribute is set to "invoker" when updating an agent. The invoker will send the following XML request to the target URI by the POST method:


   <agent  start="1"  xmlns="http://www.xmlpipe.org/xpe/manual" />

The invoked service then reacts to this request. The serivce can then do other things and returns the following response:


   <agent  hasMore="{true|false}"  xmlns="http://www.xmlpipe.org/xpe/manual" >
      {any other XML fragments to be embedded here}
   </agent>

If the hasMore attribute is "true", the agent will then POST the response as it receives back to the service again. This process continues until the service sets the hasMore attribute to "false".