diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 3ae99d1..b424034 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -1,37 +1,21 @@ -channel addAccounts { - out accounts(accounts: Map, addAccounts(id: Str, name: Str, age: Int)) = insert(accounts, id, {"name": name,"age": age}) +channel AddCompany { + out companies(comps: Map, addComp(compId: Str, compName: Str, compAdd: Str)) + = insert(comps, compId, {"name": compName, "address": compAdd}) } -channel changeNameOfAccounts(id: Str) { - out accounts.{id}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName +channel AddCustomer { + out customers(custs: Map, addCust(custId: Str, custName: Str, cumpId: Str)) + = insert(custs, custId, {"name": custName, "company": cumpId}) } -channel changeAgeOfAccounts(id: Str) { - out accounts.{id}.age(age: Int, changeAgeOfAccounts(newAge: Int)) = newAge +channel SendCompName(custId: Str) { + in customers.{custId}.company(curCompId: Str, sendCompName(compId: Str, compName: Str)) = compId + in companies.{compId}.name(curName: Str, sendCompName(compId: Str, compName: Str)) = compName + out customers.{custId}.companyName(curName: Str, sendCompName(compId, compName)) = compName } -channel addTweets { - out tweets(tweets: Map, addTweets(tweetId: Int, contents: Str, idOfAccounts: Str)) = insert(tweets, tweetId, {"contents": contents,"idOfAccounts": idOfAccounts}) +channel SendCompAddress(custId: Str) { + in customers.{custId}.company(curCompId: Str, sendCompAddress(compId: Str, compName: Str)) = compId + in companies.{compId}.address(curName: Str, sendCompAddress(compId: Str, compName: Str)) = compName + out customers.{custId}.companyAddress(curName: Str, sendCompAddress(compId, compName)) = compName } - -channel changeContentsOfTweets(tweetId: Int) { - out tweets.{tweetId}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents -} - -channel changeIdOfAccountsOfTweets(tweetId: Int) { - out tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, changeIdOfAccountsOfTweets(newIdOfAccounts: Str)) = newIdOfAccounts -} - -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 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 -} - -