Skip to content
Brice Morin edited this page Feb 9, 2016 · 2 revisions

CEP

Some constraints

Currently, the language allow to do a few of features that are not supported by the compiler. You should respect all the constraints below. We cannot guarantee the result (probably an exception will be thrown by the ThingML compiler) of a code that does not respect them.

Some of them could be managed by the compiler as a new feature in a future version.

SourceComposition: when we declare a source composition, all of them should be a receive message (a simple source). Moreover, all the messages must have the same footprint, i.e same number of parameters with the same type. Finally, you cannot mix a merge with a join. Thus, the three streams in the following example declaration are not correct:

stream incorrect do
  from mge : [ [recvPort?m1 | recvPort?m2 -> m2m3(#0,#1,#2)] | recvPort?m3 -> m2m3(#0,#1,#2)]
  action sendPort!m2m3()      
end 

message m5();
message m6(val : Integer);
stream incorrect2 do
  from mge : [ recvPort?m5 | recvPort?m6 -> m2m3(#0)]
  action sendPort!m2m3()
end

stream incorrect3 do
  from mge : [ [recvPort?m2 | recvPort?m3 -> m2m3(#0,#1,#2)] & recvPort?m2 -> m2m3()]
  action sendPort!m2m3()
end

The result message (the message wich is defined after the "->") and the output message must be the same. Thus, the following code is not correct:

stream incorrect do
  from mge : [ recvPort?m1 | recvPort?m2 -> m3()]
  action sendPort!m4() 
end

ArrayParamRef: An array parameter reference (eventRef.param[]) should be in a stream declaration, with a window operator. Thus, the following code is not correct:

message message1(param1 : Integer[]);

operator fooOp(msg : message1) : Boolean do
  print msg.param1[]
  [...]
end

stream incorrect do
  from e : [port?message1]
  select a : e.param1[]
  action sendPort!m2(a)
end
Clone this wiki locally