Open overnin opened 12 years ago
This is very interesting! Would you consider or have you thought about using xforms (or a very simple subset of it) as a basis instead of JSON? That way you might be able to benefit from a larger ecosystem of stuff being built to address the problems in this space.
------Original Message------ From: overnin To: Simon de Haan Subject: [vumi] TextToChange Generic Worker (#67) Sent: Dec 13, 2011 09:31
This worker is running a sms program that are described in a json file. The aim is to allow non technical staff to write a program description (with the help of a form) on the front end that will later be run by the worker. Obviously it will not be possible to express some complex program with a simple document tree structure, however we target to address medium complexity program.
The model is relying on 2 abstractions: dialogue and interaction
Here is a basic example of program description:
{"program":
{"name":"M4H",
"participants":[
{"phone":"0788601444"} //only one participant
]
"dialogues": [ //only one dialogue which group 2 message to be schedule
{"name":"main",
"type":"sequential", //the type=sequential tell that the interaction are following a sequential pattern
"interactions":[
{"type":"announcement", //the first interaction immediately send "Hello" to the participant
"name":"1",
"content":"Hello",
"schedule_type":"immediately"},
{"type":"announcement", //the second interaction send "How are you" 20 minutes after the first interaction
"name":"2",
"content":"How are you",
"schedule_type":"wait(00:20)"}
]
}
]
}}
Reply to this email directly or view it on GitHub: https://github.com/praekelt/vumi/issues/67
Sent via my mobile device.
I haven't consider yet those xforms implementations. After a quick look, a lot of porjects seem to have stopped since a few years (Ubiquity : 2years, FormFaces: 5years...). Considering we are looking for a more client side approach, do you have anyone to recommend?
At the moment, the proof of concept front-end is using JQuery, dform and form2js. With those simple library, one can send a Json that will be render as a from and an json will be generate back when submitting. Also you can take advantage of all the Jquery power (ajax, validation and other stuff).
I'm planning to hack together a worker next Tuesday and Wednesday that implements a USSD survey form based on the XForms output of ODK [1, 2]. This is slightly orthogonal to what you're describing in this ticket but might be of interest to you.
[1] http://opendatakit.org/ [2] http://build.opendatakit.org/
The hacking did actually happen. The results are at https://github.com/hodgestar/vodka. There is also https://github.com/praekelt/vxpolls which @smn wrote (it's not XForms based but it does simple polls).
@overnin Could you give us an update on whether this ticket is still needed?
The Xform use in Vodka, is very interesting and will be very useful for us as we are going to add the support of xForm in vusion: When creating a questionnaire in an SMS campaign, you will be able to upload an xForm.
Unfortunalty i still struggle to clearly understand what xform doesn't support. From the TextToChange business, i have identified the following points:
Therefore, at the moment we are considering a xform as a particular "dialogue" within a SMS campaign. A SMS campaign being composed of one or more dialogues. A typical example of xform use would be just after opt-in a registration questionnaire.
To come back to this ticket, the vodka example is a very good step forward. Would it be possible to add the FormHandler + the different other xform file into Vumi to be used as toolbox by ApplicationWorkers?
I don't think we need to pull any of vodka into Vumi right now but you're welcome to add functionality directly to vodka and issue pull requests to me. I'm not sure if I entirely understood your last question but vodka does already have an ApplicationWorker of its own (I think).
Ok for pull request,
Yes, it has a SingleFormWorker but the FormHandler seems more reusable. https://github.com/hodgestar/vodka/blob/develop/vodka/vumi/singleform.py
On Tue, Apr 17, 2012 at 11:28 AM, Simon Cross < reply@reply.github.com
wrote:
I don't think we need to pull any of vodka into Vumi right now but you're welcome to add functionality directly to vodka and issue pull requests to me. I'm not sure if I entirely understood your last question but vodka does already have an ApplicationWorker of its own (I think).
Reply to this email directly or view it on GitHub: https://github.com/praekelt/vumi/issues/67#issuecomment-5170411
This worker is running a sms program that are described in a json file. The aim is to allow non technical staff to write a program description (with the help of a form) on the front end that will later be run by the worker. Obviously it will not be possible to express some complex program with a simple document tree structure, however we target to address medium complexity program.
The model is relying on 2 abstractions: dialogue and interaction
Here is a basic example of program description: {"program": {"name":"M4H", "participants":[ {"phone":"0788601444"} //only one participant ] "dialogues": [ //only one dialogue which group 2 message to be schedule {"name":"main", "type":"sequential", //the type=sequential tell that the interaction are following a sequential pattern "interactions":[
{"type":"announcement", //the first interaction immediately send "Hello" to the participant "name":"1", "content":"Hello", "schedule_type":"immediately"}, {"type":"announcement", //the second interaction send "How are you" 20 minutes after the first interaction "name":"2", "content":"How are you", "schedule_type":"wait(00:20)"} ] } ] }}