The exercise consists of implementing an esb application that will provide support for human-based computation tasks.
The application will receive a file containing the details of the task, validate the information, send it to Amazon Mechanical Turk, and post the details of the created task/hit (HITTypeId) into a jms topic.
The bus will take as input a file containing the following information:
• title: title of the task
• description: description of the task
• reward: the reward of the task
• task detail: the description of the task (simple question)
The application should validate that all this information is set, and then send the task/HIT to Amazon Turk using the java api client library. The created task/hit can be viewed at: https://workersandbox.mturk.com/mturk/preview?groupId=XXX where groupId is the returned HITTypeId.
Amazon Mechanical Turk API
Amazon Mechanical Turk differentiate 2 roles:
• Worker: people that do the job
• Requester: people that request jobs to be done.
To start using amazon mechanical turk api, you need to:
1. Register on Amazon Web Services at http://aws.amazon.com/, and then go to Account->Security Credentials in order to get your keys (Access Key ID and Secret Access Key)
2. Sign-up an account as “Requester” to Amazon Turk Sanbox (testing enviroment) at https://requestersandbox.mturk.com/
1. Use the US address provided in this doc: http://svn.liquidjournal.org/bpm/alejandro.mussi/mturk-requester-address.txt
3. Download the java api client library at http://aws.amazon.com/code/Amazon-Mechanical-Turk/695, put the jars into your mule build path and config your credentials. See the HelloWorld example located into the sample folder.
More info about mTurk at: http://aws.amazon.com/mturk/
If you have problems with the unitn firewall when trying to invoke the aws api (soap calls), you can use the following url instead:
service_url=http://project-icebar.net/mturk/?Service=AWSMechanicalTurkRequester
Commit your code to the svn when you finish the task.
The exercise consists of extending the previous application by providing a notification to the user when a user start working on one of the posted task/HITs.
The esb bus have to continuously be checking (polling) the mechanical turk api in order to detect if a worker has accept and/or finish a task/hit. If any change on the status of the hit is made, the esb have to send a message to a jms topic especifying the id of the hit, the description and the new status.
There are 5 possible status of a HIT:
• Assignable – a HIT can be accepted by a Worker
• Unassignable – a HIT has been accepted by a Worker and is being worked on and therefore cannot be accepted by another Worker
• Reviewable – a Worker has submitted answers to a HIT and the HIT is available for review
• Reviewing (optional state) – the HIT is currently being reviewed by the Requester
• Disposed – the HIT has been deleted and can no longer be retrieved.
Hints:
Polling execution can be defined inside a flow with the tag <poll>
The current status of the HITS can be saved in memory (global var)
Use the javadoc of the java client api to select the method you need to call for getting the info of your HITS.