Service classifier overview

The capabilities of the Service classifier are made available when you code a service. The type is like a program that has multiple entry points.

The logic in an EGL-written service is stateless, which means that the value of each variable is specific to the invocation.

At this writing, EGL logic can request a service only if that logic is generated to JavaScript.

Here is an example of a service:
Service MyService{}

   // variables and constants can be here

   function calculate(myScore INT[]) returns (BIN (4,2)) 

      numberOfScores, i, mySum INT;
      numberOfScores = myScore.getSize();
      	
      for (i from 1 to numberOfScores by 1)
         mySum = myScore[i] + mySum;	       
      end
    	      
      return(mySum/numberOfScores);
   end

   // other functions are here

end

A Service type does not include a stereotype.