Skip to main content

Consuming ADF BC model project components from another project !

This year, let me start my posts with a simple topic. There are multiple ways to expose a project for use by other projects. One obvious approach is generate an ADF library artefact and consume it from other projects. This is documented in Fusion Middleware Fusion Developer's Guide -

 The above things are well and good. However if you you want to consume a ADF BC model project within same workspace, there is an easy way.

To consume business components defined in a model project from another model project within the same work space,

  1. Right click the model project which consumes business components from other model projects in the same workspace and select Project Properties.In the Project Properties dialogue window, select the Dependencies tab and add the 'supplier' Project by either selecting Build Output option or Jar archive option .
  2. The above steps is enough to consume Java classes from the dependent model project. To consume business components follow Step 3. 
  3. Once you define the dependencies for the consumer project, in the Project Properties window, select Imports option displayed below the ADF Business Component node. Click Import button, select the desired jpx file (jpx for the project whose business components needs to be imported to the consumer project) using file browser and then select the components that needs to be imported to the consumer project as shown in the following diagram.

You are done with the import task. Now IDE will start exposing business components in the consumer project.

Please note that, ADF development team is working on the 'dependency management' feature to make it more user friendly so that specifying dependency may be enough to consume business components from dependent project. Stay tuned, will keep you posted !


Chris Muir said…
Hi Jobinesh

In step 1, what's the difference between and pros/cons of selecting either the "Build Output" option or the "JAR Archive" option?

Thanks & regards,

jeevan said…
This comment has been removed by the author.
jeevan said…
Hi Jobinesh,

What are the deploy time ramifications for this ? I mean, How does a standalone WLS know of this dependency ? I also have the same question as Chris too.

I like the idea of splitting model projects when the underlying data-model has several layers or I'm building on a large data model and I want to organize the code to smaller logical model projects within the work-space. Is that the primary use case here to do this?

@Chris, I'm guessing the "build output" will be used when you test with the integrated WLS since you dont have to run a "deploy" to generate a jar. You'd probably never use it when deploying to a standalone WLS, since there is no build path there (You could explode the contents of a jar, but why would anyone want to do that:) ). The Jar option seems to be made for a standalone deployment, but like in my question above, I'm not sure how WLS understands this dependency.
Anonymous said…
Hi Jobinesh,

I have some external jar files in filesystem.I build a new project from ApplicationMenu New Project>Generic Project.jars are availble under new project.
How i import the packages/classes under this project to my Model Layer project as i want to use classes from this project ?


Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…