Adding a Human Task to our SOA Maven Build

In this post, we will make our SOA Application slightly more interesting, and see what we need to do to build it with Maven.  The logical next thing to add is a component that depends on MDS, so we can see the configuration required for MDS-dependent composites.  Human Tasks and Business Rules depend on MDS – they both read an XSD from MDS.  Let’s use a Human Task.

Open your composite and drag a Human Task on to the composite.  Hit OK, then double click on the new Human Task to open it.

In the Assignment tab, drag a Single Participant into Stage 1.  Now double click on the participant and select Add User and add the weblogic user.  This will route the human task to weblogic for approval.

Go to the Data tab.  In the Data section, click on the green plus icon and select Add a string parameter.  Hit OK to take the default name.

Now, open the BPEL process and drag in a Human Task from SOA Components.  Double click on the Human Task activity to open its properties.  In the Task Definition pull down box, select the Human Task you just created.  Click on the “” button in the parameters table, and assign something to the parameter.  I just used one of the inputs.

Configuring which MDS to compile against

Now we need to tell Maven about the MDS configuration.  The simplest choice is to just use the file based MDS that is included in JDeveloper.  It is already defined in the .adf/META-INF/adf-config.xml file in the SOA Application that was generated when you created the application (either with Maven or JDeveloper).


<adf-mds-config xmlns="<a href="http://xmlns.oracle.com/adf/mds/config&quot;">http://xmlns.oracle.com/adf/mds/config"</a>>
  <mds-config xmlns="<a href="http://xmlns.oracle.com/mds/config&quot;">http://xmlns.oracle.com/mds/config"</a>>
    <persistence-config>
      <metadata-namespaces>
        <namespace path="/soa/shared" metadata-store-usage="mstore-usage_1"/>
      </metadata-namespaces>
      <metadata-store-usages>
        <metadata-store-usage id="mstore-usage_1">
          <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
            <property name="metadata-path" value="${oracle.home}/integration"/>
            <property name="partition-name" value="seed"/>
          </metadata-store>
        </metadata-store-usage>
      </metadata-store-usages>
    </persistence-config>
  </mds-config>
</adf-mds-config>

If you are just going to be compiling on your own machine, this is going to be fine.  However, if you want to be able to build the composite on another machine, like a build server, then you might want to configure MDS to point to a shared repository, like a DB-backed MDS repository that is accessible to your machine and to the build server too.

To do this, you just need to update the adf-config.xml to point to the correct MDS.  Here is an example that is configured to point to a DB-backed MDS repository:


<adf-mds-config xmlns="<a href="http://xmlns.oracle.com/adf/mds/config&quot;">http://xmlns.oracle.com/adf/mds/config"</a>>
  <mds-config xmlns="<a href="http://xmlns.oracle.com/mds/config&quot;">http://xmlns.oracle.com/mds/config"</a>>
    <persistence-config>
      <metadata-namespaces>
        <namespace path="/soa/shared" metadata-store-usage="mstore-usage_1"/>
      </metadata-namespaces>
      <metadata-store-usages>
        <metadata-store-usage id="mstore-usage_1">
          <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
            <property name="jdbc-userid" value="myuser_mds"/>
            <property name="jdbc-password" value="welcome1"/>
            <property name="jdbc-url"
            value="jdbc:oracle:thin://@my.database.server:1521/my.service.name"/>
            <property name="partition-name" value="soa-infra"/>
          </metadata-store>
        </metadata-store-usage>
      </metadata-store-usages>
    </persistence-config>
  </mds-config>
</adf-mds-config>

You also need to update the POM to tell Maven where to find the adf-config.xml file.  This is done with the appHome property, which needs to point the the SOA Application (not the SOA Project) directory.  You can just uncomment it, as shown below:

image

You also need to tell Maven where your JDeveloper is installed.  You can put this into the oracleHome property in the POM, or you can specify it on the command line, as shown in the example below:


C:\src2\soaApp1>mvn compile -DoracleHome=c:\bpm1213\soa
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.redstack:soaProject1:sar:1.0-SNAPSHOT
[WARNING] The expression ${version} is deprecated. Please use ${project.version} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] soaProject1
[INFO] soaApp1
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building soaProject1 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ soaProject1 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\src2\soaApp1\soaProject1\src\main\resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- oracle-soa-plugin:12.1.3-0-0:compile (default-compile) @ soaProject1 ---
[INFO] ------------------------------------------------------------------------
[INFO] ORACLE SOA MAVEN PLUGIN - COMPILE
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ABOUT TO RUN oracle.soa.scac.ValidateComposite...
[INFO] compile: Executing: [cmd:[c:\java\jdk1.8.0_05\bin\java, -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.comm
on.classloaderurl.handler|oracle.fabric.common.uddiurl.handler, oracle.soa.scac.ValidateComposite, C:\src2\soaApp1\soaProject1/SOA//co
mposite.xml, -level=1, -appHome=C:\src2\soaApp1\soaProject1/..]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] 2014-07-14 08:12:34.678/6.375 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational configura
tion from "jar:file:/C:/Users/Mark/.m2/repository/com/oracle/coherence/coherence/12.1.3-0-0/coherence-12.1.3-0-0.jar!/tangosol-coheren
ce.xml"
[INFO] [exec] 2014-07-14 08:12:34.768/6.465 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational overrides
 from "jar:file:/C:/Users/Mark/.m2/repository/com/oracle/coherence/coherence/12.1.3-0-0/coherence-12.1.3-0-0.jar!/tangosol-coherence-o
verride-dev.xml"
[INFO] [exec] 2014-07-14 08:12:34.771/6.468 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "/tangosol-coherence-override.xml" is not specified
[INFO] [exec] 2014-07-14 08:12:34.775/6.473 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "cache-factory-config.xml" is not specified
[INFO] [exec] 2014-07-14 08:12:34.778/6.475 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "cache-factory-builder-config.xml" is not specified
[INFO] [exec] 2014-07-14 08:12:34.780/6.477 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "/custom-mbeans.xml" is not specified
[INFO] [exec]
[INFO] [exec] Oracle Coherence Version 12.1.3.0.0 Build 52031
[INFO] [exec]  Grid Edition: Development mode
[INFO] [exec] Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
[INFO] [exec]
[INFO] [exec] 2014-07-14 08:12:34.890/6.587 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Created cache factory com
.tangosol.net.DefaultConfigurableCacheFactory
[INFO] [exec] Jul 14, 2014 8:13:51 AM oracle.fabric.common.wsdl.SchemaManager isIncrementalBuildSupported
[INFO] [exec] INFO: XMLSchema incremental build enabled.
[INFO] [exec] HumanTasks/Humantask1.task: warning: Task title not specified
[INFO] [exec] HumanTasks/Humantask1.task: warning: Empty Participant definition for Stage1.Participant1
[INFO] [exec] HumanTasks/Humantask1.task: warning: Task owner not specified
[INFO] [exec] HumanTasks/Humantask1.task: warning: Error assignee not specified
[INFO] [exec] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[INFO] [exec] >> modified xmlbean locale class in use
[INFO] [exec] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[INFO] compile: [cmd:[c:\java\jdk1.8.0_05\bin\java, -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloa
derurl.handler|oracle.fabric.common.uddiurl.handler, oracle.soa.scac.ValidateComposite, C:\src2\soaApp1\soaProject1/SOA//composite.xml
, -level=1, -appHome=C:\src2\soaApp1\soaProject1/..]] exit code=0
[INFO] SOA COMPILE DONE
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building soaApp1 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] soaProject1 ....................................... SUCCESS [01:39 min]
[INFO] soaApp1 ........................................... SUCCESS [  0.003 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2014-07-14T08:14:05+10:00
[INFO] Final Memory: 14M/347M
[INFO] ------------------------------------------------------------------------
C:\src2\soaApp1>

Now our compile connects to the DB-backed MDS and uses the XSDs there to build the composite with a Human Task in it.  In the next post, let’s add an ADF User Interface for the Human Task and incorporate that into our Maven build as well.

About Mark Nelson

Mark Nelson is an Architect (an "IC6") in the Fusion Middleware Central Development Team at Oracle. Mark's job is to make Fusion Middleware easy to use in the cloud and at home, for developers and operations folks, with special focus on continuous delivery, configuration management and provisioning - making it simple to manage the configuration of complex environments and applications built with Oracle Database, Fusion Middleware and Fusion Applications, on-premise and in the cloud. Before joining this team, Mark was a senior member of the A-Team since 2010, and worked in Sales Consulting at Oracle since 2006 and various roles at IBM since 1994.
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s