Commit 945e8cf6 authored by Jeroen Henrix's avatar Jeroen Henrix

Gin editor: small fixes

 - ORYX editor initially shown at correct size
 - Generated code contains "derive class iTask" for user-defined types
 - Fixed compilation errors when including other GiN diagrams
 - Fixed mapping of infix task combinators like @:
 - TUIDiff uses JSON equality instead of generic equality, avoid unnecessary refresh
Added examples: calculateSum, auction, webauction

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1795 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent a0de014e
......@@ -73,7 +73,6 @@ itasks.tui.OryxControl = itasks.tui.extendControl(Ext.Panel,{
? this.stencilsetURL
: ORYX.CONFIG.ROOT_PATH + 'stencilsets/' + this.stencilsetURL;
this.setSize (300,200);
this.facade = new ORYX.Editor({
parentContainer: this,
stencilset: {
......
definition module auction
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
:: Bid = {user :: User, ware :: String, price :: Int}
derive class iTask Bid
/**
* newWorkflow
*
* @param bidf
* @param auctioneer
* @param bidders
* @param current
*/
newWorkflow :: (Bid -> Task Bid) User [User] Bid -> Task Bid
\ No newline at end of file
{"name":"auction","types":[],"moduleKind":["GGraphicalModule",[{"declaration":{"name":"newWorkflow","title":"auction","description":"English auction","formalParams":[{"name":"bidf","title":"bidf","type":["GFunction",["GConstructor","Bid"],["GTypeApplication",[["GConstructor","Task"],["GConstructor","Bid"]]]],"visible":true},{"name":"auctioneer","title":"auctioneer","type":["GConstructor","User"],"visible":true},{"name":"bidders","title":"bidders","type":["GList",["GConstructor","User"]],"visible":true},{"name":"current","title":"current","type":["GConstructor","Bid"],"visible":true}],"returnType":["GTypeApplication",[["GConstructor","Task"],["GConstructor","Bid"]]],"shape":"GDefaultShape"},"body":{"resourceId":"oryx_3526120D-2038-46F0-A1DD-52E0D8A630FF","properties":{},"stencil":{"id":"Diagram"},"childShapes":[{"resourceId":"oryx_DAEB9701-4372-4764-BF64-89014414BF13","properties":{},"stencil":{"id":"start"},"childShapes":[],"outgoing":[{"resourceId":"oryx_0E3861FB-FED1-47DD-B643-2B67A31E7836"}],"bounds":{"lowerRight":{"x":28,"y":129},"upperLeft":{"x":15,"y":109}},"dockers":[]},{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1","properties":{},"stencil":{"id":"case merge"},"childShapes":[],"outgoing":[{"resourceId":"oryx_799572A3-6C09-4CA9-B614-E2EA5D9385CF"}],"bounds":{"lowerRight":{"x":97,"y":129},"upperLeft":{"x":77,"y":109}},"dockers":[]},{"resourceId":"oryx_EB535241-80F1-45A6-9C8B-4A4C23D20890","properties":{},"stencil":{"id":"_split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_B63769BA-4C46-441E-9C03-A334FC71C4FD"}],"bounds":{"lowerRight":{"x":164,"y":129},"upperLeft":{"x":144,"y":109}},"dockers":[]},{"resourceId":"oryx_9E0DFE6C-55F7-4D13-9AD3-198506EBF676","properties":{"generatorpattern":"b","generatorexpression":"bidders","guard":"True","output":"b @: bidf current"},"stencil":{"id":"list comprehension"},"childShapes":[],"outgoing":[{"resourceId":"oryx_78DD06F6-B3FF-417C-AEFF-2148676C2061"}],"bounds":{"lowerRight":{"x":364,"y":163},"upperLeft":{"x":227,"y":75}},"dockers":[]},{"resourceId":"oryx_AFC580FE-B0D4-4152-96DB-E67B34B9712A","properties":{},"stencil":{"id":"anyTask"},"childShapes":[],"outgoing":[{"resourceId":"oryx_C8886B6B-EF38-4984-807C-3EF073138502"}],"bounds":{"lowerRight":{"x":426,"y":129},"upperLeft":{"x":406,"y":109}},"dockers":[]},{"resourceId":"oryx_4A0332E3-DAA9-4222-9290-101E11635CB7","properties":{"a":"newBid.price\n> current.price"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_2091FF9F-7376-44FB-BAE1-6DAB5904133E"},{"resourceId":"oryx_A6FA1B75-E79C-4D39-99EC-B7EE7E130174"}],"bounds":{"lowerRight":{"x":642,"y":156},"upperLeft":{"x":495,"y":82}},"dockers":[]},{"resourceId":"oryx_7BF42DE6-2099-4A2D-8620-2DA36DCF60D0","properties":{"a":"newBid.user\n== auctioneer"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_978E9E83-5DFE-4C34-A627-DB1EB7D8F78A"},{"resourceId":"oryx_10D658F9-3ED2-4195-8251-4EACCF5937F4"}],"bounds":{"lowerRight":{"x":641,"y":272},"upperLeft":{"x":496,"y":195}},"dockers":[]},{"resourceId":"oryx_0E3861FB-FED1-47DD-B643-2B67A31E7836","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}],"bounds":{"lowerRight":{"x":76.3125,"y":120},"upperLeft":{"x":28.90625,"y":118}},"dockers":[{"x":10,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}},{"resourceId":"oryx_799572A3-6C09-4CA9-B614-E2EA5D9385CF","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_EB535241-80F1-45A6-9C8B-4A4C23D20890"}],"bounds":{"lowerRight":{"x":143.578125,"y":120},"upperLeft":{"x":97.421875,"y":118}},"dockers":[{"x":10,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_EB535241-80F1-45A6-9C8B-4A4C23D20890"}},{"resourceId":"oryx_B63769BA-4C46-441E-9C03-A334FC71C4FD","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_9E0DFE6C-55F7-4D13-9AD3-198506EBF676"}],"bounds":{"lowerRight":{"x":226.8046875,"y":120},"upperLeft":{"x":164.9140625,"y":118}},"dockers":[{"x":10,"y":10},{"x":68,"y":44}],"target":{"resourceId":"oryx_9E0DFE6C-55F7-4D13-9AD3-198506EBF676"}},{"resourceId":"oryx_78DD06F6-B3FF-417C-AEFF-2148676C2061","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_AFC580FE-B0D4-4152-96DB-E67B34B9712A"}],"bounds":{"lowerRight":{"x":405.546875,"y":120},"upperLeft":{"x":364.0625,"y":118}},"dockers":[{"x":68,"y":44},{"x":10,"y":10}],"target":{"resourceId":"oryx_AFC580FE-B0D4-4152-96DB-E67B34B9712A"}},{"resourceId":"oryx_324C5AE4-12B8-46E7-AFFB-DD2766BF6300","properties":{"value":"current"},"stencil":{"id":"return"},"childShapes":[],"outgoing":[{"resourceId":"oryx_401A7EC6-24C5-4C1F-8D74-9B7927F213AE"}],"bounds":{"lowerRight":{"x":802,"y":250.5},"upperLeft":{"x":720,"y":216.5}},"dockers":[]},{"resourceId":"oryx_C8886B6B-EF38-4984-807C-3EF073138502","properties":{"pattern":"newBid"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_4A0332E3-DAA9-4222-9290-101E11635CB7"}],"bounds":{"lowerRight":{"x":494.82421875,"y":120},"upperLeft":{"x":426.53125,"y":118}},"dockers":[{"x":10,"y":10},{"x":73.5,"y":37}],"target":{"resourceId":"oryx_4A0332E3-DAA9-4222-9290-101E11635CB7"}},{"resourceId":"oryx_2091FF9F-7376-44FB-BAE1-6DAB5904133E","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_7BF42DE6-2099-4A2D-8620-2DA36DCF60D0"}],"bounds":{"lowerRight":{"x":569.5,"y":194.9296875},"upperLeft":{"x":567.5,"y":156.67578125}},"dockers":[{"x":73.5,"y":37},{"x":72.5,"y":38.5}],"target":{"resourceId":"oryx_7BF42DE6-2099-4A2D-8620-2DA36DCF60D0"}},{"resourceId":"oryx_978E9E83-5DFE-4C34-A627-DB1EB7D8F78A","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_324C5AE4-12B8-46E7-AFFB-DD2766BF6300"}],"bounds":{"lowerRight":{"x":719.39453125,"y":234.5},"upperLeft":{"x":641.6875,"y":232.5}},"dockers":[{"x":72.5,"y":38.5},{"x":41,"y":17}],"target":{"resourceId":"oryx_324C5AE4-12B8-46E7-AFFB-DD2766BF6300"}},{"resourceId":"oryx_3CF2A419-EC04-4535-9BC8-354BDABAAB60","properties":{"pattern":"current","expression":"newBid"},"stencil":{"id":"let"},"childShapes":[],"outgoing":[{"resourceId":"oryx_AEE41D3B-4D28-412C-B82D-C19F69CFFA8D"}],"bounds":{"lowerRight":{"x":490,"y":57},"upperLeft":{"x":390,"y":15}},"dockers":[]},{"resourceId":"oryx_A6FA1B75-E79C-4D39-99EC-B7EE7E130174","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_3CF2A419-EC04-4535-9BC8-354BDABAAB60"}],"bounds":{"lowerRight":{"x":568.5,"y":81.6875},"upperLeft":{"x":490.19140625,"y":36}},"dockers":[{"x":73.5,"y":37},{"x":568.5,"y":36},{"x":50,"y":21}],"target":{"resourceId":"oryx_3CF2A419-EC04-4535-9BC8-354BDABAAB60"}},{"resourceId":"oryx_AEE41D3B-4D28-412C-B82D-C19F69CFFA8D","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}],"bounds":{"lowerRight":{"x":389.359375,"y":108.921875},"upperLeft":{"x":87,"y":36}},"dockers":[{"x":50,"y":21},{"x":87,"y":36},{"x":10,"y":10}],"target":{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}},{"resourceId":"oryx_10D658F9-3ED2-4195-8251-4EACCF5937F4","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}],"bounds":{"lowerRight":{"x":495.0869140625,"y":233.5},"upperLeft":{"x":87,"y":129.83984375}},"dockers":[{"x":72.5,"y":38.5},{"x":87,"y":233.5},{"x":10,"y":10}],"target":{"resourceId":"oryx_67307D29-DB13-4337-8D94-1A3D084595A1"}},{"resourceId":"oryx_DB5073F7-0A36-4B18-AEAA-62F02DA68D92","properties":{},"stencil":{"id":"stop"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":894,"y":236},"upperLeft":{"x":874,"y":216}},"dockers":[]},{"resourceId":"oryx_401A7EC6-24C5-4C1F-8D74-9B7927F213AE","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_DB5073F7-0A36-4B18-AEAA-62F02DA68D92"}],"bounds":{"lowerRight":{"x":873.392478844611,"y":230.978199929549},"upperLeft":{"x":802.357521155389,"y":226.646800070451}},"dockers":[{"x":41,"y":17},{"x":10,"y":10}],"target":{"resourceId":"oryx_DB5073F7-0A36-4B18-AEAA-62F02DA68D92"}}],"bounds":{"lowerRight":{"x":1485,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"\/services\/json\/stencils\/gin","namespace":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#"},"ssextensions":["http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CommonCombinators#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CoreTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/InteractionTasks#"]}}]],"imports":["CommonCombinators","CoreTasks","InteractionTasks"]}
\ No newline at end of file
{"name":"auction","types":[{"name":"Bid","rhs":["GRecordTypeRhs",[{"name":"user","type":["GConstructor","User"]},{"name":"ware","type":["GConstructor","String"]},{"name":"price","type":["GConstructor","Int"]}]]}],"moduleKind":["GGraphicalModule",[{"declaration":{"name":"newWorkflow","title":"auction","description":"English auction","formalParams":[{"name":"bidf","title":"bidf","type":["GFunction",["GConstructor","Bid"],["GTypeApplication",[["GConstructor","Task"],["GConstructor","Bid"]]]],"visible":true},{"name":"auctioneer","title":"auctioneer","type":["GConstructor","User"],"visible":true},{"name":"bidders","title":"bidders","type":["GList",["GConstructor","User"]],"visible":true},{"name":"current","title":"current","type":["GConstructor","Bid"],"visible":true}],"returnType":["GTypeApplication",[["GConstructor","Task"],["GConstructor","Bid"]]],"shape":"GDefaultShape"},"body":{"resourceId":"oryx_838284D3-E99D-4C7B-9305-0803D7915AE1","properties":{},"stencil":{"id":"Diagram"},"childShapes":[{"resourceId":"oryx_BA7091F1-84DA-4135-8D1B-AFA612522C2E","properties":{},"stencil":{"id":"start"},"childShapes":[],"outgoing":[{"resourceId":"oryx_B9D01215-BFC9-4FEE-8C99-A46B3EF35719"}],"bounds":{"lowerRight":{"x":28,"y":129},"upperLeft":{"x":15,"y":109}},"dockers":[]},{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2","properties":{},"stencil":{"id":"case merge"},"childShapes":[],"outgoing":[{"resourceId":"oryx_6348E0B3-CC9F-4FCC-8CAF-0B676C9874BC"}],"bounds":{"lowerRight":{"x":97,"y":129},"upperLeft":{"x":77,"y":109}},"dockers":[]},{"resourceId":"oryx_51B249B9-F645-49C6-AFE0-CD3C69EFAF15","properties":{},"stencil":{"id":"_split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_98E1B096-12ED-40E8-85E5-D37C717C2C36"}],"bounds":{"lowerRight":{"x":140,"y":129},"upperLeft":{"x":120,"y":109}},"dockers":[]},{"resourceId":"oryx_0E571624-0783-490B-A85C-0DD6C64A4F95","properties":{"generatorpattern":"b","generatorexpression":"[bidders:auctioneer]","guard":"True","output":"b @: bidf current"},"stencil":{"id":"list comprehension"},"childShapes":[],"outgoing":[{"resourceId":"oryx_26F985EC-352E-4A79-B582-BC41255AFADE"}],"bounds":{"lowerRight":{"x":364,"y":163},"upperLeft":{"x":168,"y":74}},"dockers":[]},{"resourceId":"oryx_E10D84B0-AF22-4D77-8CBC-A14B0AE660EE","properties":{},"stencil":{"id":"anyTask"},"childShapes":[],"outgoing":[{"resourceId":"oryx_2EA674D8-2B2A-426B-8D17-3DE10331FCE6"}],"bounds":{"lowerRight":{"x":426,"y":129},"upperLeft":{"x":406,"y":109}},"dockers":[]},{"resourceId":"oryx_444470B8-EADF-4894-88D2-18C9494EC6DC","properties":{"a":"newBid.price\n> current.price"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_E1B2119E-8AC4-4EA2-AB91-68D1E97567CA"},{"resourceId":"oryx_4248B5C8-5B69-4706-8ED7-040E6936F21C"}],"bounds":{"lowerRight":{"x":642,"y":156},"upperLeft":{"x":495,"y":82}},"dockers":[]},{"resourceId":"oryx_C6B52F5B-05FF-46AA-A839-B061547174C5","properties":{"a":"newBid.user\n== auctioneer"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_2573B0C0-F43B-4CAB-8235-18A2BAF4B75B"},{"resourceId":"oryx_1DC5254A-B39E-4A19-BF70-7FD5B4AFC013"}],"bounds":{"lowerRight":{"x":641,"y":272},"upperLeft":{"x":496,"y":195}},"dockers":[]},{"resourceId":"oryx_B9D01215-BFC9-4FEE-8C99-A46B3EF35719","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}],"bounds":{"lowerRight":{"x":76.3125,"y":120},"upperLeft":{"x":28.90625,"y":118}},"dockers":[{"x":10,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}},{"resourceId":"oryx_6348E0B3-CC9F-4FCC-8CAF-0B676C9874BC","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_51B249B9-F645-49C6-AFE0-CD3C69EFAF15"}],"bounds":{"lowerRight":{"x":119.59375,"y":120},"upperLeft":{"x":97.40625,"y":118}},"dockers":[{"x":10,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_51B249B9-F645-49C6-AFE0-CD3C69EFAF15"}},{"resourceId":"oryx_98E1B096-12ED-40E8-85E5-D37C717C2C36","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_0E571624-0783-490B-A85C-0DD6C64A4F95"}],"bounds":{"lowerRight":{"x":167.048820698419,"y":118.961147865023},"upperLeft":{"x":140.512196637347,"y":118.863070884977}},"dockers":[{"x":10,"y":10},{"x":97.2846715328467,"y":44.5}],"target":{"resourceId":"oryx_0E571624-0783-490B-A85C-0DD6C64A4F95"}},{"resourceId":"oryx_26F985EC-352E-4A79-B582-BC41255AFADE","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_E10D84B0-AF22-4D77-8CBC-A14B0AE660EE"}],"bounds":{"lowerRight":{"x":405.580297473702,"y":118.965432505664},"upperLeft":{"x":364.014136832867,"y":118.827536244336}},"dockers":[{"x":97.2846715328467,"y":44.5},{"x":10,"y":10}],"target":{"resourceId":"oryx_E10D84B0-AF22-4D77-8CBC-A14B0AE660EE"}},{"resourceId":"oryx_8EEEFB52-6A8C-44DD-9462-F7ECD80A5DE8","properties":{"value":"current"},"stencil":{"id":"return"},"childShapes":[],"outgoing":[{"resourceId":"oryx_CD7A8C9B-948E-4BB1-A493-D5F84ADCBE35"}],"bounds":{"lowerRight":{"x":802,"y":250.5},"upperLeft":{"x":720,"y":216.5}},"dockers":[]},{"resourceId":"oryx_2EA674D8-2B2A-426B-8D17-3DE10331FCE6","properties":{"pattern":"newBid"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_444470B8-EADF-4894-88D2-18C9494EC6DC"}],"bounds":{"lowerRight":{"x":494.82421875,"y":120},"upperLeft":{"x":426.53125,"y":118}},"dockers":[{"x":10,"y":10},{"x":73.5,"y":37}],"target":{"resourceId":"oryx_444470B8-EADF-4894-88D2-18C9494EC6DC"}},{"resourceId":"oryx_E1B2119E-8AC4-4EA2-AB91-68D1E97567CA","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_C6B52F5B-05FF-46AA-A839-B061547174C5"}],"bounds":{"lowerRight":{"x":569.5,"y":194.9296875},"upperLeft":{"x":567.5,"y":156.67578125}},"dockers":[{"x":73.5,"y":37},{"x":72.5,"y":38.5}],"target":{"resourceId":"oryx_C6B52F5B-05FF-46AA-A839-B061547174C5"}},{"resourceId":"oryx_2573B0C0-F43B-4CAB-8235-18A2BAF4B75B","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_8EEEFB52-6A8C-44DD-9462-F7ECD80A5DE8"}],"bounds":{"lowerRight":{"x":719.39453125,"y":234.5},"upperLeft":{"x":641.6875,"y":232.5}},"dockers":[{"x":72.5,"y":38.5},{"x":41,"y":17}],"target":{"resourceId":"oryx_8EEEFB52-6A8C-44DD-9462-F7ECD80A5DE8"}},{"resourceId":"oryx_2DCF5253-622F-41D5-B94B-1A4988E2B115","properties":{"pattern":"current","expression":"newBid"},"stencil":{"id":"let"},"childShapes":[],"outgoing":[{"resourceId":"oryx_264E3B93-4F80-473D-BE7C-BBC643649087"}],"bounds":{"lowerRight":{"x":490,"y":57},"upperLeft":{"x":390,"y":15}},"dockers":[]},{"resourceId":"oryx_4248B5C8-5B69-4706-8ED7-040E6936F21C","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_2DCF5253-622F-41D5-B94B-1A4988E2B115"}],"bounds":{"lowerRight":{"x":568.5,"y":81.6875},"upperLeft":{"x":490.19140625,"y":36}},"dockers":[{"x":73.5,"y":37},{"x":568.5,"y":36},{"x":50,"y":21}],"target":{"resourceId":"oryx_2DCF5253-622F-41D5-B94B-1A4988E2B115"}},{"resourceId":"oryx_264E3B93-4F80-473D-BE7C-BBC643649087","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}],"bounds":{"lowerRight":{"x":389.359375,"y":108.921875},"upperLeft":{"x":87,"y":36}},"dockers":[{"x":50,"y":21},{"x":87,"y":36},{"x":10,"y":10}],"target":{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}},{"resourceId":"oryx_1DC5254A-B39E-4A19-BF70-7FD5B4AFC013","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}],"bounds":{"lowerRight":{"x":495.0869140625,"y":233.5},"upperLeft":{"x":87,"y":129.83984375}},"dockers":[{"x":72.5,"y":38.5},{"x":87,"y":233.5},{"x":10,"y":10}],"target":{"resourceId":"oryx_CDEB5D0A-14FD-49B7-AFCD-F9BD5E5B10B2"}},{"resourceId":"oryx_BE471C43-6546-4E2E-8960-2BE209579048","properties":{},"stencil":{"id":"stop"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":894,"y":236},"upperLeft":{"x":874,"y":216}},"dockers":[]},{"resourceId":"oryx_CD7A8C9B-948E-4BB1-A493-D5F84ADCBE35","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_BE471C43-6546-4E2E-8960-2BE209579048"}],"bounds":{"lowerRight":{"x":873.392478844611,"y":230.978199929549},"upperLeft":{"x":802.357521155389,"y":226.646800070451}},"dockers":[{"x":41,"y":17},{"x":10,"y":10}],"target":{"resourceId":"oryx_BE471C43-6546-4E2E-8960-2BE209579048"}}],"bounds":{"lowerRight":{"x":1485,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"\/services\/json\/stencils\/gin","namespace":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#"},"ssextensions":["http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CommonCombinators#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CoreTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/InteractionTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/webauction#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/SystemData#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/SystemTypes#"]}}]],"imports":["CommonCombinators","CoreTasks","InteractionTasks"]}
\ No newline at end of file
implementation module auction
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
derive class iTask Bid
newWorkflow :: (Bid -> Task Bid) User [User] Bid -> Task Bid
newWorkflow bidf auctioneer bidders current =
let f2 current = anyTask [(b @: bidf current) \\ b <- ([bidders:auctioneer]) | (True)]
>>= \newBid -> case (newBid.price > current.price) of
True = (\current -> f2 current) (newBid)
False = case (newBid.user == auctioneer) of
False = f2 current
True = return (current)
in f2 current
\ No newline at end of file
definition module calculateSum
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
/**
* newWorkflow
*
*/
newWorkflow :: Task Void
\ No newline at end of file
{"name":"calculateSum","types":[],"moduleKind":["GGraphicalModule",[{"declaration":{"name":"newWorkflow","formalParams":[],"returnType":["GTypeApplication",[["GConstructor","Task"],["GConstructor","Void"]]]},"body":{"resourceId":"oryx_78E5C8FB-DCE7-4E2E-B1AD-1032FEAB52A6","properties":{},"stencil":{"id":"Diagram"},"childShapes":[{"resourceId":"oryx_B061B592-0C67-4FC1-9C12-47F50671C67C","properties":{"description":"\"Enter a number\"","views":"[]"},"stencil":{"id":"enterInformation"},"childShapes":[],"outgoing":[{"resourceId":"oryx_70EBFCFB-6F4A-4A01-8E90-2F388E881E63"}],"bounds":{"lowerRight":{"x":345,"y":90},"upperLeft":{"x":45,"y":30}},"dockers":[]},{"resourceId":"oryx_63E34ECA-A76A-4FF2-BA17-B0D9248E535E","properties":{"description":"\"Enter another number\"","views":"[]"},"stencil":{"id":"enterInformation"},"childShapes":[],"outgoing":[{"resourceId":"oryx_1BE4019A-EA60-4516-AD1E-494D4E9CEA51"}],"bounds":{"lowerRight":{"x":345,"y":195},"upperLeft":{"x":45,"y":135}},"dockers":[]},{"resourceId":"oryx_8799CE7D-CBEE-4991-8808-3B3318A851DA","properties":{"description":"\"The sum of those numbers is:\"","views":"[]","data_model":"num1 + num2 + 0"},"stencil":{"id":"showInformation"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":345,"y":320},"upperLeft":{"x":45,"y":240}},"dockers":[]},{"resourceId":"oryx_70EBFCFB-6F4A-4A01-8E90-2F388E881E63","properties":{"pattern":"num1"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_63E34ECA-A76A-4FF2-BA17-B0D9248E535E"}],"bounds":{"lowerRight":{"x":196,"y":134.46875},"upperLeft":{"x":194,"y":90.53125}},"dockers":[{"x":150,"y":30},{"x":150,"y":30}],"target":{"resourceId":"oryx_63E34ECA-A76A-4FF2-BA17-B0D9248E535E"}},{"resourceId":"oryx_1BE4019A-EA60-4516-AD1E-494D4E9CEA51","properties":{"pattern":"num2"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_8799CE7D-CBEE-4991-8808-3B3318A851DA"}],"bounds":{"lowerRight":{"x":196,"y":239.46875},"upperLeft":{"x":194,"y":195.6484375}},"dockers":[{"x":150,"y":30},{"x":150,"y":40}],"target":{"resourceId":"oryx_8799CE7D-CBEE-4991-8808-3B3318A851DA"}}],"bounds":{"lowerRight":{"x":1485,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"\/services\/json\/stencils\/gin","namespace":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#"},"ssextensions":["http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CommonCombinators#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CoreTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/InteractionTasks#"]}}]],"imports":["CommonCombinators","CoreTasks","InteractionTasks"]}
\ No newline at end of file
{"name":"calculateSum","types":[],"moduleKind":["GGraphicalModule",[{"declaration":{"name":"newWorkflow","title":"Calculate sum","description":"Calculate the sum of two numbers","formalParams":[],"returnType":["GTypeApplication",[["GConstructor","Task"],["GConstructor","Void"]]],"shape":"GDefaultShape"},"body":{"resourceId":"oryx_AB86EAEB-70BC-4E01-A643-C65EF1624D5F","properties":{},"stencil":{"id":"Diagram"},"childShapes":[{"resourceId":"oryx_C56CE6AA-C3A2-4BB0-BDA8-61A270147189","properties":{"description":"\"Enter a number\"","views":"[]"},"stencil":{"id":"enterInformation"},"childShapes":[],"outgoing":[{"resourceId":"oryx_5BB1C1BF-0ACB-45CA-B5E3-5328819CD1A7"}],"bounds":{"lowerRight":{"x":281.5,"y":67},"upperLeft":{"x":80.5,"y":30}},"dockers":[]},{"resourceId":"oryx_9F955EAA-8CAC-453B-9FED-504ECFD0F0C3","properties":{"description":"\"Enter another number\"","views":"[]"},"stencil":{"id":"enterInformation"},"childShapes":[],"outgoing":[{"resourceId":"oryx_3D5E7130-A97D-44CE-99CA-E38995DB2118"}],"bounds":{"lowerRight":{"x":306.5,"y":160},"upperLeft":{"x":55.5,"y":120}},"dockers":[]},{"resourceId":"oryx_FA23C1EB-B0BE-4B07-B639-1B5B753205ED","properties":{"description":"\"The sum of those numbers is\"","views":"[]","data_model":"num1 + num2 + 0"},"stencil":{"id":"showInformation"},"childShapes":[],"outgoing":[{"resourceId":"oryx_E7952C6F-1FA5-47C7-A126-9BD990418D95"}],"bounds":{"lowerRight":{"x":329,"y":269},"upperLeft":{"x":33,"y":210}},"dockers":[]},{"resourceId":"oryx_5BB1C1BF-0ACB-45CA-B5E3-5328819CD1A7","properties":{"pattern":"num1"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_9F955EAA-8CAC-453B-9FED-504ECFD0F0C3"}],"bounds":{"lowerRight":{"x":182,"y":119.69921875},"upperLeft":{"x":180,"y":67.37109375}},"dockers":[{"x":100.5,"y":18.5},{"x":125.5,"y":20}],"target":{"resourceId":"oryx_9F955EAA-8CAC-453B-9FED-504ECFD0F0C3"}},{"resourceId":"oryx_3D5E7130-A97D-44CE-99CA-E38995DB2118","properties":{"pattern":"num2"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_FA23C1EB-B0BE-4B07-B639-1B5B753205ED"}],"bounds":{"lowerRight":{"x":181,"y":209.73828125},"upperLeft":{"x":181,"y":160.43359375}},"dockers":[{"x":125.5,"y":20},{"x":148,"y":29.5}],"target":{"resourceId":"oryx_FA23C1EB-B0BE-4B07-B639-1B5B753205ED"}},{"resourceId":"oryx_E7952C6F-1FA5-47C7-A126-9BD990418D95","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_662D4B2C-2E74-49D8-A09A-D85F0A57F78B"}],"bounds":{"lowerRight":{"x":181,"y":314.328125},"upperLeft":{"x":181,"y":269.34765625}},"dockers":[{"x":148,"y":29.5},{"x":60,"y":30}],"target":{"resourceId":"oryx_662D4B2C-2E74-49D8-A09A-D85F0A57F78B"}},{"resourceId":"oryx_662D4B2C-2E74-49D8-A09A-D85F0A57F78B","properties":{"type":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#case split","a":"","value":"Void"},"stencil":{"id":"return"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":241,"y":374.5},"upperLeft":{"x":121,"y":315}},"dockers":[]}],"bounds":{"lowerRight":{"x":1485,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"\/services\/json\/stencils\/gin","namespace":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#"},"ssextensions":["http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CommonCombinators#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CoreTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/InteractionTasks#"]}}]],"imports":["CommonCombinators","CoreTasks","InteractionTasks"]}
\ No newline at end of file
implementation module calculateSum
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
newWorkflow :: Task Void
newWorkflow =
enterInformation ("Enter a number") ([])
>>= \num1 -> enterInformation ("Enter another number") ([])
>>= \num2 -> showInformation ("The sum of those numbers is") ([]) (num1 + num2 + 0)
>>| return (Void)
\ No newline at end of file
definition module webauction
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
:: Bid = {user :: User, ware :: String, price :: Int}
derive class iTask Bid
/**
* webAuction
*
* @param auctioneer
* @param bidders
* @param current
*/
webAuction :: User [User] Bid -> Task Bid
\ No newline at end of file
{"name":"webauction","types":[{"name":"Bid","rhs":["GRecordTypeRhs",[{"name":"user","type":["GConstructor","User"]},{"name":"ware","type":["GConstructor","String"]},{"name":"price","type":["GConstructor","Int"]}]]}],"moduleKind":["GGraphicalModule",[{"declaration":{"name":"webAuction","title":"web auction","description":"Web-based auction in English style","formalParams":[{"name":"auctioneer","title":"auctioneer","type":["GConstructor","User"],"visible":true},{"name":"bidders","title":"bidders","type":["GList",["GConstructor","User"]],"visible":true},{"name":"current","title":"current","type":["GConstructor","Bid"],"visible":true}],"returnType":["GTypeApplication",[["GConstructor","Task"],["GConstructor","Bid"]]],"shape":"GDefaultShape"},"body":{"resourceId":"oryx_4BCEEF71-7EFD-478F-9676-699DF587178D","properties":{},"stencil":{"id":"Diagram"},"childShapes":[{"resourceId":"oryx_3853DCAB-2024-4DDF-AA53-AD5D5E3E817B","properties":{},"stencil":{"id":"start"},"childShapes":[],"outgoing":[{"resourceId":"oryx_35050837-F9EE-4A5F-9667-17E5C5AD9EBB"}],"bounds":{"lowerRight":{"x":28,"y":148},"upperLeft":{"x":15,"y":128}},"dockers":[]},{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09","properties":{},"stencil":{"id":"case merge"},"childShapes":[],"outgoing":[{"resourceId":"oryx_9CFB5389-2DB6-4A86-AEF5-69035E1FFE71"}],"bounds":{"lowerRight":{"x":80,"y":148},"upperLeft":{"x":60,"y":128}},"dockers":[]},{"resourceId":"oryx_AB7C5EBC-581A-47A1-8A19-429FEFFDD7DD","properties":{},"stencil":{"id":"_split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_76805185-305C-4E85-A9B7-0696D99D6A6E"}],"bounds":{"lowerRight":{"x":130.5,"y":148},"upperLeft":{"x":110.5,"y":128}},"dockers":[]},{"resourceId":"oryx_EDA4870E-C967-45BE-BF40-F248CB038202","properties":{"generatorpattern":"b","generatorexpression":"[auctioneer:bidders]","guard":"True","output":""},"stencil":{"id":"list comprehension"},"childShapes":[{"resourceId":"oryx_3FEED28D-93EE-4C64-827E-69609A6F613A","properties":{"user":"b","task":""},"stencil":{"id":"@:"},"childShapes":[{"resourceId":"oryx_A6421D26-ACF5-42BA-A1D4-7864DF12DA14","properties":{"description":"\"Make your bid\"","views":"[]","data_model":"{Bid | current & user = b}"},"stencil":{"id":"updateInformation"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":318,"y":61},"upperLeft":{"x":60,"y":8}},"dockers":[]}],"outgoing":[],"bounds":{"lowerRight":{"x":338,"y":144},"upperLeft":{"x":15,"y":75}},"dockers":[]}],"outgoing":[{"resourceId":"oryx_2F04E619-D81C-4AA4-8988-07D6E6A88336"}],"bounds":{"lowerRight":{"x":501,"y":216},"upperLeft":{"x":150,"y":60}},"dockers":[]},{"resourceId":"oryx_AC769803-B108-4BA7-B8C1-8E29A46676B6","properties":{},"stencil":{"id":"anyTask"},"childShapes":[],"outgoing":[{"resourceId":"oryx_932F387A-3E75-4450-91BA-2849BA0ABF2A"}],"bounds":{"lowerRight":{"x":560,"y":148},"upperLeft":{"x":540,"y":128}},"dockers":[]},{"resourceId":"oryx_0668031C-9854-40EB-9EA9-9447B28A63D2","properties":{"a":"newBid.price\r\n> current.price"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_9B928C07-7083-45C6-ABAF-CE33A3925BD5"},{"resourceId":"oryx_F0BB045B-D713-4802-9C6B-D30703A0D272"}],"bounds":{"lowerRight":{"x":776,"y":175},"upperLeft":{"x":629,"y":101}},"dockers":[]},{"resourceId":"oryx_6C301635-7C56-46F2-AA7A-0660E4502F2F","properties":{"a":"newBid.Bid.user\r\n== auctioneer"},"stencil":{"id":"case split"},"childShapes":[],"outgoing":[{"resourceId":"oryx_CEE22304-5D3B-4FA5-80F8-A618C8457102"},{"resourceId":"oryx_11200543-2087-41D1-B15C-3C45B3BD97A2"}],"bounds":{"lowerRight":{"x":775,"y":302},"upperLeft":{"x":630,"y":225}},"dockers":[]},{"resourceId":"oryx_35050837-F9EE-4A5F-9667-17E5C5AD9EBB","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}],"bounds":{"lowerRight":{"x":59.71875,"y":139},"upperLeft":{"x":28.8125,"y":137}},"dockers":[{"x":1,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}},{"resourceId":"oryx_9CFB5389-2DB6-4A86-AEF5-69035E1FFE71","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_AB7C5EBC-581A-47A1-8A19-429FEFFDD7DD"}],"bounds":{"lowerRight":{"x":110.03125,"y":139},"upperLeft":{"x":80.46875,"y":137}},"dockers":[{"x":10,"y":10},{"x":10,"y":10}],"target":{"resourceId":"oryx_AB7C5EBC-581A-47A1-8A19-429FEFFDD7DD"}},{"resourceId":"oryx_76805185-305C-4E85-A9B7-0696D99D6A6E","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_EDA4870E-C967-45BE-BF40-F248CB038202"}],"bounds":{"lowerRight":{"x":149.739535812044,"y":138},"upperLeft":{"x":131.04932709854,"y":138}},"dockers":[{"x":10,"y":10},{"x":174.21897810219,"y":78}],"target":{"resourceId":"oryx_EDA4870E-C967-45BE-BF40-F248CB038202"}},{"resourceId":"oryx_2F04E619-D81C-4AA4-8988-07D6E6A88336","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_AC769803-B108-4BA7-B8C1-8E29A46676B6"}],"bounds":{"lowerRight":{"x":539.298471715328,"y":138},"upperLeft":{"x":501.610401459854,"y":138}},"dockers":[{"x":174.21897810219,"y":78},{"x":10,"y":10}],"target":{"resourceId":"oryx_AC769803-B108-4BA7-B8C1-8E29A46676B6"}},{"resourceId":"oryx_5DDCDCEC-C76B-4740-8F66-0F670A0EA998","properties":{"value":"current"},"stencil":{"id":"return"},"childShapes":[],"outgoing":[{"resourceId":"oryx_56BFF5A5-F940-45F6-987E-71F7CC80DE2B"}],"bounds":{"lowerRight":{"x":937,"y":280.5},"upperLeft":{"x":855,"y":246.5}},"dockers":[]},{"resourceId":"oryx_932F387A-3E75-4450-91BA-2849BA0ABF2A","properties":{"pattern":"newBid"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_0668031C-9854-40EB-9EA9-9447B28A63D2"}],"bounds":{"lowerRight":{"x":628.82421875,"y":139},"upperLeft":{"x":560.53125,"y":137}},"dockers":[{"x":10,"y":10},{"x":73.5,"y":37}],"target":{"resourceId":"oryx_0668031C-9854-40EB-9EA9-9447B28A63D2"}},{"resourceId":"oryx_9B928C07-7083-45C6-ABAF-CE33A3925BD5","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_6C301635-7C56-46F2-AA7A-0660E4502F2F"}],"bounds":{"lowerRight":{"x":703.5,"y":224.26171875},"upperLeft":{"x":701.5,"y":175.27734375}},"dockers":[{"x":73.5,"y":37},{"x":72.5,"y":38.5}],"target":{"resourceId":"oryx_6C301635-7C56-46F2-AA7A-0660E4502F2F"}},{"resourceId":"oryx_CEE22304-5D3B-4FA5-80F8-A618C8457102","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_5DDCDCEC-C76B-4740-8F66-0F670A0EA998"}],"bounds":{"lowerRight":{"x":854.18359375,"y":264.5},"upperLeft":{"x":775.306640625,"y":262.5}},"dockers":[{"x":72.5,"y":38.5},{"x":41,"y":17}],"target":{"resourceId":"oryx_5DDCDCEC-C76B-4740-8F66-0F670A0EA998"}},{"resourceId":"oryx_2156D07E-92C0-4A0F-ABED-4F24297C9D81","properties":{"pattern":"current","expression":"newBid"},"stencil":{"id":"let"},"childShapes":[],"outgoing":[{"resourceId":"oryx_79AAF303-A222-4A99-BC57-604A80633FBC"}],"bounds":{"lowerRight":{"x":640,"y":57},"upperLeft":{"x":540,"y":15}},"dockers":[]},{"resourceId":"oryx_F0BB045B-D713-4802-9C6B-D30703A0D272","properties":{"pattern":"True"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_2156D07E-92C0-4A0F-ABED-4F24297C9D81"}],"bounds":{"lowerRight":{"x":702.5,"y":100.34375},"upperLeft":{"x":640.21875,"y":36}},"dockers":[{"x":73.5,"y":37},{"x":702.5,"y":36},{"x":50,"y":21}],"target":{"resourceId":"oryx_2156D07E-92C0-4A0F-ABED-4F24297C9D81"}},{"resourceId":"oryx_79AAF303-A222-4A99-BC57-604A80633FBC","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}],"bounds":{"lowerRight":{"x":539.234375,"y":128},"upperLeft":{"x":70,"y":36}},"dockers":[{"x":50,"y":21},{"x":70,"y":36},{"x":10,"y":1}],"target":{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}},{"resourceId":"oryx_11200543-2087-41D1-B15C-3C45B3BD97A2","properties":{"pattern":"False"},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}],"bounds":{"lowerRight":{"x":629.849609375,"y":263.5},"upperLeft":{"x":70,"y":149}},"dockers":[{"x":72.5,"y":38.5},{"x":70,"y":263.5},{"x":10,"y":20}],"target":{"resourceId":"oryx_DC5F8508-9DD0-4F2E-B8E3-6ED7AD4BBD09"}},{"resourceId":"oryx_B733F205-A675-426B-8516-1737165EA482","properties":{},"stencil":{"id":"stop"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":995,"y":273.5},"upperLeft":{"x":975,"y":253.5}},"dockers":[]},{"resourceId":"oryx_56BFF5A5-F940-45F6-987E-71F7CC80DE2B","properties":{"pattern":""},"stencil":{"id":"Arc"},"childShapes":[],"outgoing":[{"resourceId":"oryx_B733F205-A675-426B-8516-1737165EA482"}],"bounds":{"lowerRight":{"x":974.265625,"y":264.5},"upperLeft":{"x":937.328125,"y":262.5}},"dockers":[{"x":41,"y":17},{"x":10,"y":10}],"target":{"resourceId":"oryx_B733F205-A675-426B-8516-1737165EA482"}}],"bounds":{"lowerRight":{"x":1485,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"\/services\/json\/stencils\/gin","namespace":"http:\/\/mbsd.icis.ru.nl\/itasks\/gin#"},"ssextensions":["http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CommonCombinators#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/CoreTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/InteractionTasks#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/webauction#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/SystemData#","http:\/\/mbsd.icis.ru.nl\/itasks\/gin\/SystemTypes#"]}}]],"imports":["CommonCombinators","CoreTasks","InteractionTasks"]}
\ No newline at end of file
implementation module webauction
import StdInt, StdBool, StdString, StdList, StdOrdList, StdTuple, StdEnum, StdOverloaded, StdFile
import CommonCombinators, CoreCombinators, CoreTasks, InteractionTasks
derive class iTask Bid
webAuction :: User [User] Bid -> Task Bid
webAuction auctioneer bidders current =
let f2 current = anyTask [(b)
@: updateInformation ("Make your bid") ([]) ({Bid | current & user = b}) \\ b <-
([auctioneer:bidders]) | (True)]
>>= \newBid -> case (newBid.price > current.price) of
True = (\current -> f2 current) (newBid)
False = case (newBid.Bid.user == auctioneer) of
False = f2 current
True = return (current)
in f2 current
\ No newline at end of file
......@@ -115,7 +115,7 @@ staticContainerUpdate path old new = flatten [diffEditorDefinitions` (childDataP
valueUpdate path old new = update sameValue (\{value} -> Just value) TUISetValue path old new
where
sameValue old new = ov === new.value
sameValue old new = ov == new.value
where
ov = case new.eventValue of
Just v = toJSON v
......
......@@ -183,6 +183,7 @@ printAModule opt aMod =
scope ( [ printAModuleHeader opt aMod ]
++ printAImports opt aMod.AModule.imports
++ printATypes opt aMod.AModule.types
++ printATypeDerives opt aMod.AModule.types
++ flatten (map (printADefinition opt) aMod.AModule.definitions)
++ printAStart opt aMod
)
......@@ -223,6 +224,14 @@ printATypes :: PrintOption [GTypeDefinition] -> [a] | Printer a
printATypes opt _ | opt == POICL = []
printATypes opt types = map (printGTypeDefinition) types
printATypeDerives :: PrintOption [GTypeDefinition] -> [a] | Printer a
printATypeDerives opt types = flatten (map (printATypeDerive opt) types)
printATypeDerive :: PrintOption GTypeDefinition -> [a] | Printer a
printATypeDerive opt {name, rhs = GSynonymTypeRhs _} = []
printATypeDerive opt {name, rhs = GAbstractTypeRhs} = []
printATypeDerive opt {GTypeDefinition | name} = [text "derive class iTask" <+> text name]
printADefinition :: PrintOption ADefinition -> [a] | Printer a
printADefinition opt def =
printADefinitionComment opt def
......@@ -297,7 +306,7 @@ printAStart _ _ = []
printAExpression :: PrintOption Bool (AExpression Void) -> a | Printer a
printAExpression opt withParens (Unparsed s) = parens (string (replaceSubString "\n" " " s))
printAExpression opt withParens (Unparsed s) = parens (string (replaceSubString "\n" " " (replaceSubString "\r" "" s)))
printAExpression opt withParens (Lit s) = text s
printAExpression opt withParens (Var v) = text v
printAExpression opt withParens (App exps) = addParens withParens (fillSep (map (printAExpression opt True) exps))
......
......@@ -114,7 +114,7 @@ where
build source basename config lineMap iworld
# (res, iworld) = accWorldIWorld (readFile (config.iTasksPath </> "Server" </> "Gin" </> "project-template")) iworld
| isError res = (CompileGlobalError ("Failed to read project template file: " +++ toString (fromError res)), iworld)
# projectFile = replaceSubString "{Basename}" basename (fromOk res)
# projectFile = replaceSubString "{UserPath}" config.userPath (replaceSubString "{Basename}" basename (fromOk res))
# (res, iworld) = accWorldIWorld (writeFile (filenameFromConfig config tmpDirectory basename "prj") projectFile) iworld
| isError res = (CompileGlobalError ("Failed to write project file: " +++ toString (fromError res)), iworld)
# projectFile = filenameFromConfig config tmpDirectory basename "prj"
......@@ -331,6 +331,7 @@ ginApplicationOptions = { DefApplicationOptions & o = NoConsole}
searchPaths :: !GinConfig !String -> [String]
searchPaths config tempPath =
[ tempPath
: config.userPath
: map ((</>) config.iTasksPath) iTasksPaths
++ map ((</>) config.cleanPath) cleanPaths
]
......
......@@ -131,12 +131,8 @@ mapFunction doc ident prio (Yes st)
Prio assoc pri = AppInfix ident.id_name (mapAssoc assoc) pri (Extension (PBBranch 0)) (Extension (PBBranch 1))
}
)
where
mapAssoc :: Assoc -> AFix
mapAssoc LeftAssoc = Infixl
mapAssoc RightAssoc = Infixr
mapAssoc NoAssoc = Infix
mapFunction doc ident _ (Yes st)
mapFunction doc ident prio (Yes st)
| not doc.FunctionComment.parallel
= (Just ( NodeBinding
{ NodeBinding
......@@ -163,13 +159,20 @@ mapFunction doc ident _ (Yes st)
Just filename = GExternalShape filename
Nothing = GDefaultShape
}
, parameterMap = NBPrefixApp
, parameterMap = case prio of
NoPrio = NBPrefixApp
Prio assoc pri = NBInfixApp (mapAssoc assoc) pri
}
)
)
mapFunction _ _ _ _ = Nothing
mapAssoc :: Assoc -> AFix
mapAssoc LeftAssoc = Infixl
mapAssoc RightAssoc = Infixr
mapAssoc NoAssoc = Infix
mapFormalParameter :: !ParamComment AType -> GFormalParameter
mapFormalParameter doc type =
{ GFormalParameter
......
......@@ -301,15 +301,18 @@ nodeToAExpression bindings node =
NBPrefixApp =
if (isEmpty node.GNode.actualParams)
(ret (Var node.GNode.name))
(parseChildMap (gToAExpressionPath bindings o snd)
(argsToExpressions nb >>> \exps = ret (App [(Var node.GNode.name) : exps]))
NBInfixApp fix prio =
argsToExpressions nb >>> \[exp1, exp2: _] ->
ret (AppInfix node.GNode.name fix prio exp1 exp2)
)
where
argsToExpressions :: NodeBinding -> GParseState [AExpression Void]
argsToExpressions nb = parseChildMap (gToAExpressionPath bindings o snd)
[(fromMaybe formalParam.GFormalParameter.name formalParam.GFormalParameter.title, actualParam)
\\ formalParam <- nb.NodeBinding.declaration.GDeclaration.formalParams
& actualParam <- node.GNode.actualParams
] >>> \exps =
ret (App [(Var node.GNode.name) : exps]))
)
]
//-------------------------------------------------------------------------------------------
//Mapping of parallel subgraphs
......
......@@ -119,8 +119,8 @@ newModuleName config
>>= \name -> moduleExists config name
>>= \exists -> if exists
( showInformation ("Module " +++ name +++ " already exists, do you want to overwrite?") [] Void
>?* [ (ActionNo, Always (return name))
, (ActionYes, Always (newModuleName config))
>?* [ (ActionYes, Always (return name))
, (ActionNo, Always (newModuleName config))
]
)
( return name )
......
......@@ -38,6 +38,7 @@ Global
ExportedNames:
Paths
Path: {Project}
Path: {UserPath}
Precompile:
Postlink:
MainModule
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment