diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 5992f7f..3ae99d1 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -1,51 +1,37 @@ channel addAccounts { - out accounts(accounts: Map, addAccounts(aid: Str, name: Str)) = insert(accounts, aid, {"name": name}) + out accounts(accounts: Map, addAccounts(id: Str, name: Str, age: Int)) = insert(accounts, id, {"name": name,"age": age}) } -channel changeNameOfAccounts(aid: Str) { - out accounts.{aid}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName +channel changeNameOfAccounts(id: Str) { + out accounts.{id}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName +} + +channel changeAgeOfAccounts(id: Str) { + out accounts.{id}.age(age: Int, changeAgeOfAccounts(newAge: Int)) = newAge } channel addTweets { - out tweets(tweets: Map, addTweets(tid: Str, contents: Str, aidOfAccountName: Str)) = insert(tweets, tid, {"contents": contents,"aidOfAccountName": aidOfAccountName}) + out tweets(tweets: Map, addTweets(tweetId: Int, contents: Str, idOfAccounts: Str)) = insert(tweets, tweetId, {"contents": contents,"idOfAccounts": idOfAccounts}) } -channel changeContentsOfTweets(tid: Str) { - out tweets.{tid}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents +channel changeContentsOfTweets(tweetId: Int) { + out tweets.{tweetId}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents } -channel changeAidOfAccountNameOfTweets(tid: Str) { - out tweets.{tid}.aidOfAccountName(aidOfAccountName: Str, changeAidOfAccountNameOfTweets(newAidOfAccountName: Str)) = newAidOfAccountName +channel changeIdOfAccountsOfTweets(tweetId: Int) { + out tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, changeIdOfAccountsOfTweets(newIdOfAccounts: Str)) = newIdOfAccounts } -channel nameOfAccountNameOfTweets(tid: Str){ - in tweets.{tid}.aidOfAccountName(aidOfAccountName: Str, nameOfAccountNameOfTweets(newAidOfAccountName: Str, newNameOfAccountName: Str)) = newAidOfAccountName - in accounts.{newAidOfAccountName}.name(name: Str, nameOfAccountNameOfTweets(newAidOfAccountName, newNameOfAccountName)) = newNameOfAccountName - out tweets.{tid}.nameOfAccountName(nameOfAccountName, nameOfAccountNameOfTweets(newAidOfAccountName, newNameOfAccountName)) = newNameOfAccountName +channel nameOfAccountsOfTweets(tweetId: Int){ + in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, nameOfAccountsOfTweets(newIdOfAccounts: Str, newNameOfAccounts: Str)) = newIdOfAccounts + in accounts.{newIdOfAccounts}.name(name: Str, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts + out tweets.{tweetId}.nameOfAccounts(nameOfAccounts, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts } -channel addFollow { - out follow(follow: Map, addFollow(fid: Str, aidOfFollower: Str, aidOfFollowee: Str)) = insert(follow, fid, {"aidOfFollower": aidOfFollower,"aidOfFollowee": aidOfFollowee}) -} - -channel changeAidOfFollowerOfFollow(fid: Str) { - out follow.{fid}.aidOfFollower(aidOfFollower: Str, changeAidOfFollowerOfFollow(newAidOfFollower: Str)) = newAidOfFollower -} - -channel nameOfFollowerOfFollow(fid: Str){ - in follow.{fid}.aidOfFollower(aidOfFollower: Str, nameOfFollowerOfFollow(newAidOfFollower: Str, newNameOfFollower: Str)) = newAidOfFollower - in accounts.{newAidOfFollower}.name(name: Str, nameOfFollowerOfFollow(newAidOfFollower, newNameOfFollower)) = newNameOfFollower - out follow.{fid}.nameOfFollower(nameOfFollower, nameOfFollowerOfFollow(newAidOfFollower, newNameOfFollower)) = newNameOfFollower -} - -channel changeAidOfFolloweeOfFollow(fid: Str) { - out follow.{fid}.aidOfFollowee(aidOfFollowee: Str, changeAidOfFolloweeOfFollow(newAidOfFollowee: Str)) = newAidOfFollowee -} - -channel nameOfFolloweeOfFollow(fid: Str){ - in follow.{fid}.aidOfFollowee(aidOfFollowee: Str, nameOfFolloweeOfFollow(newAidOfFollowee: Str, newNameOfFollowee: Str)) = newAidOfFollowee - in accounts.{newAidOfFollowee}.name(name: Str, nameOfFolloweeOfFollow(newAidOfFollowee, newNameOfFollowee)) = newNameOfFollowee - out follow.{fid}.nameOfFollowee(nameOfFollowee, nameOfFolloweeOfFollow(newAidOfFollowee, newNameOfFollowee)) = newNameOfFollowee +channel ageOfAccountsOfTweets(tweetId: Int){ + in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, ageOfAccountsOfTweets(newIdOfAccounts: Str, newAgeOfAccounts: Int)) = newIdOfAccounts + in accounts.{newIdOfAccounts}.age(age: Int, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts + out tweets.{tweetId}.ageOfAccounts(ageOfAccounts, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts } diff --git a/AlgebraicDataflowArchitectureModel/models/SimpleUI2.model b/AlgebraicDataflowArchitectureModel/models/SimpleUI2.model index a6f9074..9c08080 100644 --- a/AlgebraicDataflowArchitectureModel/models/SimpleUI2.model +++ b/AlgebraicDataflowArchitectureModel/models/SimpleUI2.model @@ -2,16 +2,16 @@ screenTemplates := { "000": { "widgets": { - "001": {"type": "textInput", "text": "", "state": 0}, - "002": {"type": "button", "text": "Next", "state": 0}, - "005": {"type": "label", "text": "aaa", "state": 0} + "001": {"type": "textInput", "text": "", "state": 0, "visible": true}, + "002": {"type": "button", "text": "Next", "state": 0, "visible": true}, + "005": {"type": "label", "text": "aaa", "state": 0, "visible": true} }, "layout": true }, "001": { "widgets": { - "003": {"type": "label", "text": "label", "state": 0}, - "004": {"type": "button", "text": "Back", "state": 0} + "003": {"type": "label", "text": "label", "state": 0, "visible": true}, + "004": {"type": "button", "text": "Back", "state": 0, "visible": true} }, "layout": true } diff --git a/AlgebraicDataflowArchitectureModel/models/SimpleUI3.model b/AlgebraicDataflowArchitectureModel/models/SimpleUI3.model index 79643c3..729c318 100644 --- a/AlgebraicDataflowArchitectureModel/models/SimpleUI3.model +++ b/AlgebraicDataflowArchitectureModel/models/SimpleUI3.model @@ -2,33 +2,33 @@ screenTemplates := { "000": { "widgets": { - "001": {"type": "label", "text": "aid", "state": 0}, - "002": {"type": "textInput", "text": "", "state": 0}, - "003": {"type": "label", "text": "name", "state": 0}, - "004": {"type": "textInput", "text": "", "state": 0}, - "005": {"type": "button", "text": "ok", "state": 0}, - "006": {"type": "button", "text": "search", "state": 0} + "001": {"type": "label", "text": "aid", "state": 0, "visible": true}, + "002": {"type": "textInput", "text": "", "state": 0, "visible": true}, + "003": {"type": "label", "text": "name", "state": 0, "visible": true}, + "004": {"type": "textInput", "text": "", "state": 0, "visible": true}, + "005": {"type": "button", "text": "ok", "state": 0, "visible": true}, + "006": {"type": "button", "text": "search", "state": 0, "visible": true} }, "layout": true }, "001" :{ "widgets": { - "101": {"type": "label", "text": "success!", "state": 0}, - "102": {"type": "button", "text": "back", "state": 0} + "101": {"type": "label", "text": "success!", "state": 0, "visible": true}, + "102": {"type": "button", "text": "back", "state": 0, "visible": true} }, "layout": true }, "002": { "widgets": { - "201": {"type": "textInput", "text": "", "state": 0}, - "202": {"type": "label", "text": "aid", "state": 0}, - "203": {"type": "label", "text": "", "state": 0} + "201": {"type": "textInput", "text": "", "state": 0, "visible": true}, + "202": {"type": "label", "text": "aid", "state": 0, "visible": true}, + "203": {"type": "label", "text": "", "state": 0, "visible": true} } }, "409": { "widgets": { - "491": {"type": "label", "text": "conflilct!", "state": 0}, - "492": {"type": "button", "text": "back", "state": 0} + "491": {"type": "label", "text": "conflilct!", "state": 0, "visible": true}, + "492": {"type": "button", "text": "back", "state": 0, "visible": true} }, "layout": true } @@ -78,14 +78,6 @@ out screen.widgets.{wid}.text(curText: Str, textEvent(nextText)) = nextText } -channel addAccount { - out accounts(accounts, addAccounts(aid: Str, name: Str)) = insert(accounts, aid, name) -} - -channel changeName(aid: Str) { - out accounts.{aid}.name(curName, changeName(nextName)) = nextName -} - channel ChangeCurScreen { out curScreen(curScId: Str, changeCurScreen(nextScId)) = nextScId } @@ -108,6 +100,14 @@ out screenTemplates.{curScId}.widgets.{wid}.text(curText: Str, dispatchEvent(curScId, wid, nextText)) = nextText } +channel addAccount { + out accounts(accounts, addAccounts(aid: Str, name: Str)) = insert(accounts, aid, name) +} + +channel changeName(aid: Str) { + out accounts.{aid}.name(curName, changeName(nextName)) = nextName +} + channel EventHandler2(scId: Str, wid: Str) { in screenTemplates.{scId="000"}.widgets.{wid="006"}.state(curState: Str, handleEvent(nextState)) = nextState out curScreen(curScId: Str, handleEvent(nextState)) = if(nextState == 0, "002", curScId)