Personal tools
You are here: Home Developer Interest Groups Web User Interface Interest Group KFlex

KFlex

This page contains information about the KFlex, an Adobe Flex based Kepler Client developed at the German Research Center for Artificial Intelligence (DFKI) www.dfki.de.

KFlex has been developed within the IVIP Project. The IVIP project was funded by the Ministry for Economy, Transport, Agriculture and Viniculture (MWVLW) and is part of the EU Program:
"Ziel 2 Programm RLP".

KFlex

Introduction:

KFlex (Kepler Flex) is an extended version of Kepler with an Adobe Flex 3 client developed at the German Research Center for Artificial Intelligence (DFKI).

KFlex consists of two components:

  • KFlex Server: An extended version of the Kepler 1.0.0 release with WebService interface for workflows and packaged as Wep Application
  • KFlex Client: An Adobe Flex 3 prototypical implementation of a Kepler client to edit and execute Kepler workflows (see snapshot below)

KFlex - Simple Workflow
 

Contact:

Christopher J. Tuot

DFKI GmbH (German Research Center for Artificial Intelligence)
Knowledge Management Department
 
mail: kepler[at]ctuot.com

License:

  • KFlex Server: Open-Source (same license as Kepler 1.0)
  • KFlex Client: OpenSource (Code not yet released)

KFlex Server

Goal:

KFlex Server offers a WebService interface for Kepler workflows.

Limitations:

The inputs and outputs of the Kepler Workflows must be prototyped using the Kepler actors:

  • KeplerWebServiceInput
  • KeplerWebServiceOuput

This is necessary since Input/Output types in Kepler are not specific enough to genereate the wsdl automatically.

Source and binaries

The source code has not yet been integrated into the Kepler repository.

Deployment and configuration

  1. Deploy the war file in your favorite application server (e.g. tomcat 6.x)
  2. Depending on the kind of workflows you are willing to run, you might need to provide more memory to your application server. For tomcat, I added the following line to $TOMCAT_HOME/bin/catalina.sh. If your application server is running on an environment without Graphical User Interface, " -Djava.awt.headless=true" might also hepl.
    JAVA_OPTS="-XX:MaxPermSize=256m -Xmx2048M  -Djava.awt.headless=true"
  3. Edit the WEB-INF/web.xml file and change the path to the directory containing the Kepler Workflows to be made available as WebService.
    <context-param>
        <param-name>pathWebServicesPool</param-name>
        <param-value>/export/demos/KFlex/wspool</param-value>
    </context-param>

Usage:

Kepler workflows stored in the WebServices Directory pool can be accessed as follow:

  • WSDL URL: (workflowName is the name of the workflow. At the moment the name of the file and the name of the workflow MUST be the same!!!)
    http://server:8080/KFlexServer/WSDL?workflow=worflowname

Example:

Below is a very simple example of a KFlex workflow that computes the length of a given String.

KFlex SebService Workflow Example

 

  • The inputs and the outputs of the Web-Service are defined using respectively the actors WebServiceInput and WebServiceOuput.
  • The name of the input variable is the name given to the WebServiceInput actor. The name of the output variable is the name given to the WebServiceOutput actor. You can therefore define several inputs and outputs by giving different names to the WebServiceInput and WebServiceOutput actors.
  • The type of the input can be defined using the property typeLocalName of the WebServiceInput actor. In the same way, the type of the output  can be defined using the property typeLocalName of the WebServiceOuptut actor. The supported types are the same as for SOAP 1.1. In our example, the input is a String and the ouput an Integer. See details below:
    <entity name="WebServiceInput" class="org.dfki.rapr.kepler.util.WebServiceInput">
            <property name="typeLocalName" class="ptolemy.data.expr.StringParameter" value="string">
            </property>
            <property ...
            </property>
        </entity>
        <entity name="WebServiceOutput" class="org.dfki.rapr.kepler.util.WebServiceOutput">
            <property name="typeLocalName" class="ptolemy.data.expr.StringParameter" value="int">
            </property>
            <property...
            </property>
        </entity>
  • The WebServieInput actor has an input port that can be used for local test purposes in Kepler. In out example, we use a constant actor to locally inject a String variable in the workflow. In the same way, the WebServiceOuput actor has an ouput port. In our example the ouput of the workflow is visualized using a Monitor Value actor.
  • If you save the workflow xml definition in the KFlex Worklfow Pool Directory under the name: webservice_test.xml, you can now access the WSDL definition of the worklfow:
    http://server:8080/KFlexServer/WSDL?workflow=webservice_test.xml
  • The WSDL definiotn should be like following:

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions targetNamespace="uri:webinterface:kepler:rapr:dfki:org"
            xmlns="http://schemas.xmlsoap.org/wsdl/"
            xmlns:NS1="http://schemas.xmlsoap.org/wsdl/soap/"
            xmlns:NS2="http://www.w3.org/2001/XMLSchema"
            xmlns:NS3="uri:webinterface:kepler:rapr:dfki:org">
      <types/>
      <message name="webservice_testRequest">
        <part name="WebServiceInput" type="NS2:string"/>
      </message>
      <message name="webservice_testResponse">
        <part name="WebServiceOutput" type="NS2:int"/>
      </message>
      <portType name="webservice_testPort">
        <operation name="webservice_testOperation">
          <input message="NS3:webservice_testRequest"/>
          <output message="NS3:webservice_testResponse"/>
        </operation>
      </portType>
      <binding name="webservice_testBinding" type="NS3:webservice_testPort">
        <binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="webservice_testOperation">
          <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="webservice_test" style="rpc"/>
          <input>
            <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="uri:webinterface:kepler:rapr:dfki:org" use="literal"/>
          </input>
          <output>
            <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="uri:webinterface:kepler:rapr:dfki:org" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="webservice_testService">
        <port binding="NS3:webservice_testBinding" name="webservice_testPort">
          <address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://serv-4101:8080/KFlexServer-1.0.1/SOAP?workflow=webservice_test"/>
        </port>
      </service>
    </definitions>

KFlex Client

Source and binaries:

The source code has not yet been integrated into the Kepler repository.

Deployment and configuration:

  1. Deploy the application on your favorite web server (e.g. Apache Server 2.x)
  2. Copy the crossdomain.xml file to the ROOT directory of your application server (e.g. $TOMCAT_HOME/webapps/ROOT/)
  3. Edit the serversettings.xml file and define the url to the KFlexServer. Leave other parameters unchanged!
    <ServerSettings>
        <urlKeplerServlets>http://server:8080/KFlexServer-1.0.1/</urlKeplerServlets>
        <uploadMoML>UploadMoML</uploadMoML>
        <reloadMoML>ReloadMoML?id=</reloadMoML>
        <KARMoML>KARMoML?class=</KARMoML>
        <ActorIcon>ActorIcon?class=</ActorIcon>
        <ListActor>ListActors</ListActor>
        <GetWorkflowMoML>GetWorkflowMoML?id=</GetWorkflowMoML>
        <WorkflowsManager>WorkflowsManager?</WorkflowsManager>
        <GetRuntimeValue>GetRuntimeValue?</GetRuntimeValue>
        <crossdomain>crossdomain.xml</crossdomain>
    </ServerSettings>

Getting started:

Open your favorite browser and navigate to the following url:

http://server/KFlexClient/KeplerFlexClient.html

Go to the menu Debug and select one of the test:

  • Load test 
  • Load test 

Click on the Run button to execute the workflow.

Document Actions