Warning: session_start(): open(/var/lib/php/sessions/sess_1291m5lbkb6cqa5cvue62rlekh, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass FormInFlight {
Conversation conversation;
S hashTag;
new L steps;
int stepIndex; // in steps list
S handleInput(S s) { null; }
FormStep currentStep() {
ret get(steps, stepIndex);
}
void update(Runnable onChange) {
if (currentStep() != null) currentStep().update(onChange);
}
S complete() { ret "Form complete"; }
S cancel() { ret "Request cancelled"; }
FormStep byKey(S key) {
ret objectWhere(steps, +key);
}
S getValue(S key) {
FormStep step = byKey(key);
ret step?.value;
}
SS allValues() {
SS map = litorderedmap();
for (FormStep step : steps)
map.put(step.key, step.value);
ret map;
}
bool allowGeneralOverride() { false; }
Conversation cancelMe() {
Conversation conv = conversation;
print("cancelMe called");
// TODO: conversation.cancelForm();
ret conv;
}
void change {
if (conversation != null) conversation.change();
}
}
abstract concept BotShowForm > BotStep {
abstract FormInFlight makeForm();
bool run(Conversation conv) {
Form form = makeForm();
true;
}