Use case

(Taken from esme-dev mailing list: still needs to be confirmed)

  1.  One of the Purchasing employees posted this in the Purchasing micro-blog group: "@victoria I just ordered 3,000 more G70" (G70 is an item "Kidco fireplace gate"). to let his boss know that he ordered what they discussed some days ago.
  2.  Akibot picked up the conversation and understood that 3,000 G70 were ordered (through the contextual analyzer
  3. Akibot inquired the purchasing history for G70 (through an ERP feed) and noticed that this was an unusual quantity (through the directive processor)
  4. Akibot then called up another application that inquiries the price for G70 in Amazon and other online retailers (through the directive processor as well)
  5. Akibot found that Toys'r'us is selling G70 cheaper (through the directive processor as well)
  6. Since Purchasing just ordered more G70, and competitors are selling it cheaper, there will be a problem!
  7. Akibot posts back a message alerting the Sales group:  "Purchasing just ordered 3,000 more G70. We're selling it at $194.99, the competition at $184.99 (Toysrus)"
  8. Sales will contact Purchasing, and either they lower the price or cancel the purchase order

This "reasoning" that Akibot has, is through directives. This use case above is one directive. Akibot comes with standard directives and you can add custom directives ("teach" him). These directives can be shared by other companies using Akibot, so the more companies use Akibot, the more Akibot learns...

Technical Description

  1. Messages are post in ESME
  2. ESME sends message to Akibot via HTTP POST
  3. Akibot acknowledges the message reception by responding the HTTP POST call with an XML response
  4. Akibot store the message and processes it through its Contextual Analyzer (C>A) module
  5. If necessary, Akibot makes inquiries the corresponding enterprise (ERP or Groupware) application via HTTP REQUEST
  6. The enterprise application processes the inquiry
  7. The enterprise application responds to the inquiry with an XML response
  8. Akibot processes the enterprise application response with its Directive Processor (DP), which decides if any action is to be taken
  9. If Akibot decides that an action needs to be taken (for now, just sending back a message to the microblog) it does so by sending the message via HTTP POST call to ESME
  10. (Optional) ESME can send back an acknowledge to Akibot letting it know that the message was successfully received
Integration analysis: ESME Action

Use ESME's existing action architecture to post to akibot via its HTTP POST interface.

We can post to twitter via this mechanism so should also be able to post to you guys as well.

For example,

http://user:password@identi.ca/api/statuses/update.xml
status=%s

The Akibot REST API to send messages has the following parameters:

Name

Description

Type

Optional

Example

Message

Message to be sent

String

 

We're going to launch the Akibot campaign on 11/26/09

Key

Application Key

String

 

 

Message ID

Id of the message to send

 

 

1214

Urgent

Whether message is urgent or not

Number

 

0

Private

Whether message is private or not

Number

 

0

Group ID

ID of group involved

Number

 

1413

User ID

ID of user sending the message

Number

 

1765

User Nick

Nickname of user sending the message

String

 

BobSmith

Message timestamp

Timestamp of message to be sent

Timestamp

 

2009-11-03 10:07:08

We just have to map our parameters to these values.

Iterations

  1. Use existing akibot infrastructure and attempt to use ESME's action mechanism to post to akibot's REST API
  2. Start changing akibot infrastructure (contextual analyzer, etc) to be more ESME-specific

Questions

  1. What sort of back-end system are we talking about? Are you already using a system that we can re-use for initial tests?
  2. We also have to agree on what sort of message contents (formats, etc.) will be used Are there special words (invoice, etc.) that are necessary. This is, of course, linked to what sort of back-end you guys are using.
  3. What sort of rules are present in the DP? The obvious one would be to create an ESME message.
  4. Regarding 10, we do respond with a XML response to those submitting messages via REST API
  5. Do you want to use the old REST API or the new "Streaming API" (Ethan's baby :->)?
  6. We just probably use a POST action as Ethan suggests as a first step
  7. You are right about the messaging threads needing standardization (especially 2 and 9). Maybe you can look at my table in the wiki page and tell me about what the parameters mean and whether they are optional or not. We will have to map them to our fields.
  8. We also have to think about user-ids. Do they need to be synchronized? Probably....
  • No labels

3 Comments

  1. imho besides the technical integration a very important point is the user interface integration. The whole thing with microblogging is a simple userinterface (which hides backend complexity). I really like the concept of Google Wave's bots. For the user everything is just an agent - be it human or not. We currently try this with sensor microblogging. We have temperature sensors which tweet just their temperature ("12.3"). Then, we have a little bot who takes all postings from the microblog he follows and adds hashtags based on several conditions. The user just sees the input (followed microblogs) and the output (the bot's microblog). At the bot's URL you can see the transformation rules in detail.

    All this can be perfectly implemented with Twitter. However, Twitter lacks a runtime for the bots. They have to be hosted elsewhere. Imo it would be cool if ESME would provide a standard runtime to host plugins (like Akibot would be one) inside the ESME environment.

    1. We've thrown around the idea of plugins before. There are at least two locations/functional areas that come into questions. Message parsing and actions. The idea would be to have the ability to define which plugins are available (perhaps via configuration file) and then have these plugins join in the processing chain. Since Scala can use java classes, java would be the best way to write such plugins. Of course, performance considerations would also have to be considered.

      Regarding your idea of temperature sensor and the bot, I've always thought of bots that add tags as one of the most important possibilitites. Of course, you need logic in the bots to be create intelligent tags. 

      If you want, we could start a new wiki page or a esme-dev discussion to talk about plug-in requirements.

      1. Dick, give me a few days/weeks to finish our Twitter-bot project. This running example could help us talking about requirements. I will come back to you once this little project is finished.

        What Twitter cannot support is changing postings via bots (like the spell checker in Google Wave). The question is: is this useful, may we allow it?