SMPL Application Usage

A SMPL Application is an XML based 'SiMple Process Language' implementation. A sample application example is listed below. Note that the EOA approach to system architecture effectively removes many of the 'hoops' that you're forced to jump through when implementing other XML based process languages. The language below is, in our opinion, simpler and much more intuitive.

Please note that this implementation is still in the 'planning' stages, i.e. we hope to begin implementing it soon. If you have experience developing this type of application, and would like to participate, please send an email to developers@alakai.org

Application Example

<process name="MyProcess" xmlns="http://bluestemsoftware.org/specification/eoa/ext/application/smpl/1.0" 
  
  targetNamespace="http://myserver.mycompany.com:/smpl/process/1.0" 
  xmlns:tns="http://myserver.mycompany.com:/smpl/process/1.0"
  xmlns:ns01="http://org.industry.standards/message"
  xmlns:ns02="http://com.software.vendor/application/1.0">
  
  <partners>
    <partner name="me" partnerType="tns:MyProcess"/>
    <partner name="them" partnerType="ns02:SomeApplication"/>
  </partners>
  
  <variables>
    <variable name="request" element="ns01:Request"/>
    <variable name="response" element="ns01:Response"/>
  </variables>
  
  <sequence>
  
    <!-- 
      receives a request and instantiates process, note that the only requirement
      for 'my' role name is that it be unique within context of MyProcess. see
      sample eoa deployment descriptor for example of role name to interface name
      mapping, i.e. within wsdl:application element
     -->
    
    <receive partner="me" 
             role="seller" 
             action="urn:myOperationRequest" 
             variable="request" 
             createInstance="yes"/> 
             
 
    <switch>
      
      <case condition="getVariableData('request', 'body', './ns01:values/ns01:value') &lt; 26">
       
        <!-- 
          if value within request is less than 26, we forward request to
          an engine assigned at runtime, i.e. an engine which hosts
          an instance of 'ns02:SomeApplication' at dallas location
        -->
           
        <assign>
          <copy>
            <from xmlns:ns="http://com.distributor/dallas" engine="ns:Engine"/>
            <to partner="them"/>
          </copy>
        </assign> 
               
      </case>
      
      <otherwise>
        
        <!-- 
          if value within request is greater than 25, we forward request to
          an engine assigned at runtime, i.e. an engine which hosts an
          instance of application at chicago location. note that engine's
          must both implement the same application, i.e. ns02:SomeApplication
          or process will fail to compile
         -->
        
        <assign>
          <copy>
            <from xmlns:ns="http://com.distributor/chicago" engine="ns:Engine"/>
            <to partner="them"/>
          </copy>
        </assign> 
          
      </otherwise>
      
    </switch>
 
    <!-- 
      note that if service defined on partner engine which implements
      the distributor role defines more than one endpoint, the endpoint
      chosen is clarified via engine meta-data, i.e. an attribute on
      endpoint reference component which orders available endpoints
      by preference. SMPL process engine will iterate over endpoints
      in order of preference and execute each until message is
      successfully sent
     -->  
   
    <send partner="them"
          role="distributor"
          action="urn:someOperationRequest" 
          variable="request"/>
 
     <!-- 
        now we receive response from distributor, i.e. ns01:doSomething MEP is
        'in-out'. if response is not yet available, the process is dehydrated
        and will be rehydrated when response arrives
     -->
     
     <receive partner="them" 
              role="distributor"
              action="urn:someOperationResponse" 
              variable="response"/> 
             
    <!-- 
      now we return the response to the application that called us. note that
      the 'receive' and 'send' elements are all that are required to 
      receive/send requests and/or receive/send responses.
     -->         
    
    <send partner="me"
          role="seller"
          action="urn:myOperationResponse " 
          variable="response"/>
           
  </sequence>
  
</process>

MyProcess Deployment Descriptor

The following descriptor contains all the necessary static components and runtime component definitions for the 'MyProcess' application. Note, that typically these would be defined within separate deployments, e.g. one deployment for the abstract, static components, one for the concrete, static components, one for the runtime application and one for the runtime engine.

<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <components>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://myserver.mycompany.com:/smpl/process/1.0" xmlns:tns="http://myserver.mycompany.com:/smpl/process/1.0">
      <wsdl:types>
        <xs:import namespace="http://org.industry.standards/message" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
      </wsdl:types>
      <wsdl:interface name="MyInterface" xmlns:ns01="http://mycompany.com/business/docs">
        <wsdl:operation name="myOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
          <wsdl:input element="ns01:Request" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" wsam:Action="urn:myOperationRequest" />
          <wsdl:output element="ns01:Response" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" wsam:Action="urn:myOperationResponse" />
        </wsdl:operation>
      </wsdl:interface>
      <wsdl:binding name="MyBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.2" wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/" />
      <wsdl:service name="MyService" interface="tns:MyInterface">
        <wsdl:endpoint name="MyEndpoint" binding="tns:MyBinding" address="http://localhost:8080/eoa/ws/MyService/MyEndpoint/"/>
      </wsdl:service>
      <ext:application xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="MyProcess">
        <ext:role name="seller" interface="tns:MyInterface" />
      </ext:application>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="MyProcessEngine" application="tns:MyProcess">
        <ext:actor role="seller" service="tns:MyService" />
      </ext:engine>
    </wsdl:description>
  </components>
  <providers>
    <application xmlns="http://bluestemsoftware.org/specification/eoa/ext/application/smpl/1.0" xmlns:tns="http://myserver.mycompany.com:/smpl/process/1.0" name="tns:MyProcess">
      <documentURI>resources/process.xml</documentURI>
    </application>
    <engine xmlns="http://bluestemsoftware.org/specification/eoa/ext/engine/smpl/1.0" xmlns:tns="http://myserver.mycompany.com:/smpl/process/1.0" name="tns:MyProcessEngine">
      <configuration>
        <!-- runtime configuration goes here -->
      </configuration>
      <partners>
        <engineReference xmlns:ns="http://com.distributor/dallas" engineName="ns:Engine" />
        <engineReference xmlns:ns="http://com.distributor/chicago" engineName="ns:Engine" />
      </partners>
    </engine>
  </providers>
</deployment>

SomeApplication Deployment Descriptor

The following descriptor contains all the necessary static components and runtime component definitions for the 'SomeApplication' partner. Note, that typically these would be defined within separate deployments, e.g. one deployment for the abstract, static components, one for the concrete, static components with each of the concrete engine definitions separated into different deployments as well.

<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <components>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.software.vendor/application/1.0" xmlns:tns="http://com.software.vendor/application/1.0">
      <wsdl:types>
        <xs:import namespace="http://org.industry.standards/message" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
      </wsdl:types>
      <wsdl:interface name="MyInterface" xmlns:ns01="http://mycompany.com/business/docs">
        <wsdl:operation name="someOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
          <wsdl:input element="ns01:Request" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" wsam:Action="urn:someOperationRequest" />
          <wsdl:output element="ns01:Response" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" wsam:Action="urn:someOperationResponse" />
        </wsdl:operation>
      </wsdl:interface>
      <ext:application xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="SomeApplication">
        <ext:role name="distributor" interface="tns:MyInterface" />
      </ext:application>
    </wsdl:description>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.distributor/dallas" xmlns:tns="http://com.distributor/dallas" >
      <wsdl:binding name="MyBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.2" wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/" />
      <wsdl:service name="MyService" interface="tns:MyInterface">
        <wsdl:endpoint name="MyEndpoint" binding="tns:MyBinding" address="http://com.distributor.dallas:8080/eoa/ws/MyService/MyEndpoint/"/>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="Engine" xmlns:ns="http://com.software.vendor/application/1.0" application="ns:SomeApplication">
        <ext:actor role="distributor" service="tns:MyService" />
      </ext:engine>
    </wsdl:description>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.distributor/chicago" xmlns:tns="http://com.distributor/chicago" >
      <wsdl:binding name="MyBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.2" wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/" />
      <wsdl:service name="MyService" interface="tns:MyInterface">
        <wsdl:endpoint name="MyEndpoint" binding="tns:MyBinding" address="http://com.distributor.chicago:8080/eoa/ws/MyService/MyEndpoint/"/>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="Engine" xmlns:ns="http://com.software.vendor/application/1.0" application="ns:SomeApplication">
        <ext:actor role="distributor" service="tns:MyService" />
      </ext:engine>
    </wsdl:description>
  </components>
</deployment>