Wednesday, February 5, 2014

Fuse Service Works Simple Demo v1

This demonstration will give you a quick example of Fuse Service Works v6.  The Orders v1 example includes a Switchyard Application, using Design Time Governance and using Run Time Governance.


1. Download the Fuse Service Works Installer from http://www.jboss.org/products/fsw.html

2. Run the Fuse Service Works Installer and start the standalone server.

3. Install the DTGov workflow from the dtgov-data.  Use S-RAMP username and password from the install (fswAdmin/redhat1!).

mvn clean deploy

4. sign onto DTGov - http://localhost:8080/dtgov-ui/ in the S-RAMP repository notice the DTGov workflow dtgov-workflows-1.0.1.Final-redhat-6.jar


5. Run 

mvn clean install

for the orders demo in quickstarts/switchyard/demos/orders.  The build should show success and a order SOAP test should have been successful.

6. copy war to deployments from target/switchyard-quickstart-demo-orders.war

7. verify WSDL - http://localhost:8080/demo-orders/OrderService?wsdl and submit order with SOAP or run mvn exec:java to send order

8. verify JSF - http://localhost:8080/switchyard-quickstart-demo-orders-1.1.1-p5-redhat-1/home.jsf and submit order



9. View the switchyard application in JBDS


10. Check the DTGov Workflow in JBDS in the dtgov-workflows under src/main/resources/SRAPMPackage view overlord.demo.SimpleReleaseProcess.bpmn



11. Deploy to DTGov to view the deployment in S-RAMP and follow the workflow (NOTE: this will go through the defined workflow but the /tmp/[environment] directories would have to be setup to deployment folders for jboss servers to deploy to an environment). Replace the pom.xml with

  <?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
-
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.switchyard.quickstarts</groupId>
        <artifactId>switchyard-quickstart-parent</artifactId>
        <version>1.1.1-p5-redhat-1</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <groupId>org.switchyard.quickstarts.demos</groupId>
    <artifactId>switchyard-quickstart-demo-orders</artifactId>
    <packaging>war</packaging>
    <name>Quickstart Demo : Orders</name>
   
  <properties>
    <switchyard.version>1.1.1-p5-redhat-1</switchyard.version>
    <version.org.overlord.sramp-s-ramp-wagon>0.3.1.Final-redhat-7</version.org.overlord.sramp-s-ramp-wagon>
  </properties>
  
    <dependencies>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-bean</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-soap</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-test</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-test-mixin-cdi</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-test-mixin-http</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Import the CDI API, we use provided scope as the API is included in JBoss AS 7 -->
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Import the Common Annotations API (JSR-250), we use provided scope as the API is included in JBoss AS 7 -->
        <dependency>
            <groupId>org.jboss.spec.javax.annotation</groupId>
            <artifactId>jboss-annotations-api_1.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Import the JSF API, we use provided scope as the API is included in JBoss AS 7 -->
        <dependency>
            <groupId>org.jboss.spec.javax.faces</groupId>
            <artifactId>jboss-jsf-api_2.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>${project.artifactId}</finalName>
       <extensions>
      <extension>
        <groupId>org.overlord.sramp</groupId>
        <artifactId>s-ramp-wagon</artifactId>
        <version>${version.org.overlord.sramp-s-ramp-wagon}</version>
      </extension>
    </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <debug>true</debug>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.switchyard</groupId>
                <artifactId>switchyard-plugin</artifactId>
                <configuration>
                    <scannerClassNames>
                <param>org.switchyard.component.bean.config.model.BeanSwitchYardScanner</param>
                        <param>org.switchyard.transform.config.model.TransformSwitchYardScanner</param>
                    </scannerClassNames>
                    <!-- Output to war directory -->
                    <outputFile>${project.build.directory}/${project.build.finalName}/WEB-INF/switchyard.xml</outputFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>configure</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>org.switchyard.quickstarts.demos.orders.OrdersClient</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
   
  <profiles>   
    <profile>
      <id>demo</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>local-sramp-repo</id>
          <name>S-RAMP Releases Repository</name>
          <url>sramp://localhost:8080/s-ramp-server/?artifactType=SwitchYardApplication</url>
        </repository>
        <snapshotRepository>
          <id>local-sramp-repo-snapshots</id>
          <name>S-RAMP Snapshots Repository</name>
          <url>sramp://localhost:8080/s-ramp-server/?artifactType=SwitchYardApplication</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>
  
<!-- Modified by POM Artifact-Version Manipulator version 1.3.6-redhat-4-soa (20c6737) -->
</project>

12. deploy to DTGov NOTE: enter S-RAMP user/pass if prompted fswAdmin/redhat1!

mvn -Pdemo -DskipTests=true -Dsramp.auth.username=fswAdmin -Dsramp.auth.password=redhat1! clean deploy

it should indicate build success and server console should indicate workflow started.

13. On the task inbox, Claim, Start and Pass the Dev task which should move the deployment to QA



14. RTGov: to be added.