Service classifier overview

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

An EGL-generated service can be deployed as a REST service. The logic in an EGL-written service is stateless, which means that the value of each variable is specific to the invocation.

Any EGL logic part can request a service. When you code the requester, you declare a variable for service access, and that variable is based on a type. If the service was EGL generated, you can use the Service part as the type. For further details on service invocation, see details on the Interface classifier in “Classifiers for defining EGL prototype parts.”

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 part does not include a stereotype.