diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 5aa585c..b31a1b0 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -11,11 +11,13 @@ } channel addTweets { - ref accounts(accounts: Map, addTweets(accounts: Map, tweetId: Str, accountId: Str, contents: Str)) + 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), + = if( + contains(accounts, accountId), insert(tweets, tweetId, {"accountId": accountId, "contents": contents}), - tweets) + tweets + ) } channel changeTweetsAccountId(tweetId: Str) {