diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 13dbfc9..5992f7f 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -1,29 +1,51 @@ channel addAccounts { - out accounts(accounts: Map, addAccounts(id: Str, name: Str, age: Int)) = insert(accounts, id, {"name": name, "age": age}) + out accounts(accounts: Map, addAccounts(aid: Str, name: Str)) = insert(accounts, aid, {"name": name}) } -channel changeAccountsName(id: Str) { - out accounts.{id}.name(name: Str, changeAccountsName(newName: Str)) = newName -} - -channel changeAccountsAge(id: Str) { - out accounts.{id}.name(age: Int, channgeAccountsAge(newAge: Int)) = newAge +channel changeNameOfAccounts(aid: Str) { + out accounts.{aid}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName } channel addTweets { - in accounts(accounts: Map, addTweets(newAccounts: Map, tweetId: Str, accountId: Str, contents: Str)) = newAccounts - out tweets(tweets: Map, addTweets(accounts, tweetId, accountId, contents)) - = if( - contains(accounts, accountId), - insert(tweets, tweetId, {"accountId": accountId, "contents": contents}), - tweets - ) + out tweets(tweets: Map, addTweets(tid: Str, contents: Str, aidOfAccountName: Str)) = insert(tweets, tid, {"contents": contents,"aidOfAccountName": aidOfAccountName}) } -channel changeTweetsAccountId(tweetId: Str) { - out tweets.{tweetId}.accountId(accountId: Str, changeTweetsAccountId(newAccountId: Str)) = newAccountId +channel changeContentsOfTweets(tid: Str) { + out tweets.{tid}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents } -channel changeTweetsContents(tweetId: Str) { - out tweets.{tweetId}.contents(contents: Str, changeTweetsContents(newContents: Str)) = newContents -} \ No newline at end of file +channel changeAidOfAccountNameOfTweets(tid: Str) { + out tweets.{tid}.aidOfAccountName(aidOfAccountName: Str, changeAidOfAccountNameOfTweets(newAidOfAccountName: Str)) = newAidOfAccountName +} + +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 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 +} + +