Scenario:
I have the following simple process -
Payload is as follows -
I deploy the composite and then pick up the WSDL from EM
Click on the icon -
I then create a new "Generic" project in JDev and add a Web Service Proxy based on the above WSDL.
JDev does its magic and all I need to do is add the following code to the auto-generated client
public class NiallCSimpleOrdersProcessPortClient
{
@WebServiceRef
private static NiallCSimpleOrdersProcessService niallCSimpleOrdersProcessService;
public static void main(String [] args)
{
niallCSimpleOrdersProcessService = new NiallCSimpleOrdersProcessService();
NiallCSimpleOrdersProcessPortType niallCSimpleOrdersProcessPortType =
niallCSimpleOrdersProcessService.getNiallCSimpleOrdersProcessPort();
// MY CODE HERE
Order order = new Order();
order.setCustCountry("IE");
order.setUnitPrice(new BigDecimal("199.99") );
order.setCustEmail("n@c.com");
order.setCustFirstName("Niall");
order.setCustLastName("Commiskey");
order.setExportRestriction("N");
order.setOrderNr("123");
order.setProduct("iToaster");
order.setQuantity(10);
niallCSimpleOrdersProcessService.getNiallCSimpleOrdersProcessPort().start(order);
}
}
I run the client and check for the instance in EM -
Simple stuff!
Monday, November 11, 2013
Tuesday, October 29, 2013
#282 Oracle SOA Governance 11g Implementation - Packt Publishing
Just got my hands on the above title and am looking forward to reviewing it.
The book covers -
The book covers -
- Oracle Enterprise Repository (OER)
- Oracle Service Registry (OSR)
- Oracle JDeveloper
- Web Services Manager (WSM)
- Oracle API Gateway (OAG fka OEG)
- Oracle Enterprise Manager (OEM)
The book promises to cover key concepts and practical guidelines on how to implement service governance.
Review starting soon...
BTW. the book is available here
Friday, October 11, 2013
#281 Log level dependencies in BPM 11g
From a BPM perspective, we can set logging at the following levels -
Say I want to debug bpm auditing - I can activate the following -
I test my composite and see no traces in the log -
Now, I go to the composite and enable bpm logging there -
Re-test
Check log file -
Say I want to debug bpm auditing - I can activate the following -
I test my composite and see no traces in the log -
Now, I go to the composite and enable bpm logging there -
Re-test
Check log file -
Friday, October 4, 2013
Monday, September 30, 2013
# 279 Oracle B2b Book - Chapters 5 - 11
Just to finish off my review of this book -
Chapter 5 - Setting up B2B Transactions
discusses the B2B lifecycle from creating documents, trading partner agreements, reporting and monitoring etc. It also introduces integration with SOA Suite and enterprise manager.
Chapter 6 - SOA Suite Integration
A step by step guide to creating a B2B SOA Composite. Also contains a very useful section
on B2B design best practices.
Chapter 7 - Reporting and Monitoring
Covers usage of B2B itself, Enterpise Manager and BAM for reporting purposes.
Explains succinctly what you get OOTB and how easy it is to provide value-add via BAM.
Chapter 8 - Exception Handling
Covers exception handling at B2B level ( inbound/outbound), SOA Composite level and also covers custom exception handling.
Chapter 9 - Oracle B2B Security Management
This chapter details the security features available OOTB with B2B along with the integration with Oracle FMW security infrastructure.
Chapter 10 - Preparing to go -live
The chapter title is self-explanatory - a must read!
Chapter 11 - Advanced Topics.
Covers Java callouts, the extremely valuable B2B Self-Service Utility along with the relevant APIS.
Again, a must read!
All in all an excellent book - heavy on examples - a real Hands-On...
Well done Scott et al.
Again, the Link
Chapter 5 - Setting up B2B Transactions
discusses the B2B lifecycle from creating documents, trading partner agreements, reporting and monitoring etc. It also introduces integration with SOA Suite and enterprise manager.
Chapter 6 - SOA Suite Integration
A step by step guide to creating a B2B SOA Composite. Also contains a very useful section
on B2B design best practices.
Chapter 7 - Reporting and Monitoring
Covers usage of B2B itself, Enterpise Manager and BAM for reporting purposes.
Explains succinctly what you get OOTB and how easy it is to provide value-add via BAM.
Chapter 8 - Exception Handling
Covers exception handling at B2B level ( inbound/outbound), SOA Composite level and also covers custom exception handling.
Chapter 9 - Oracle B2B Security Management
This chapter details the security features available OOTB with B2B along with the integration with Oracle FMW security infrastructure.
Chapter 10 - Preparing to go -live
The chapter title is self-explanatory - a must read!
Chapter 11 - Advanced Topics.
Covers Java callouts, the extremely valuable B2B Self-Service Utility along with the relevant APIS.
Again, a must read!
All in all an excellent book - heavy on examples - a real Hands-On...
Well done Scott et al.
Again, the Link
# 278 BPM API - Initiator Tasks
Here is my composite -
Here is the app link in Workspace
Now I want to initiate via the API.
First Kudos to Rommel Pino's post here
A great starting point -
Anyway - let's get a list of the Initiable Processes I have deployed, and then initiate the above process.
I create a project in jdev and include the following jars -
Code -
package initiatorapi;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import oracle.bpel.services.bpm.common.IBPMContext;
import oracle.bpel.services.workflow.client.IWorkflowServiceClient;
import oracle.bpel.services.workflow.client.IWorkflowServiceClientConstants;
import oracle.bpel.services.workflow.client.WorkflowServiceClientFactory;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpm.client.BPMServiceClientFactory;
import oracle.bpm.services.client.IBPMServiceClient;
import oracle.bpm.services.instancemanagement.IInstanceManagementService;
import oracle.bpm.services.processmetadata.IProcessMetadataService;
import oracle.bpm.services.processmetadata.ProcessMetadataSummary;
public class InitiableProcesses {
private static String url = "t3://localhost:7001";
public InitiableProcesses() {
super();
}
public void getInitiatiableProcesses() {
System.out.println("getInitiatiableProcesses()");
try {
IProcessMetadataService service =
getBPMServiceClient().getProcessMetadataService();
IBPMContext bpmContext = getIBPMContext("weblogic", "welcome1");
List initiableTasks =
service.getInitiatableProcesses(bpmContext);
for (ProcessMetadataSummary pms : initiableTasks) {
System.out.println(pms.getProjectName() + "/" +
pms.getProcessName());
System.out.println("App Link " +
pms.getApplicationLinkDisplayName());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(" #################### ");
}
public void initiateProcess(String processName) {
System.out.println(" +++ initiateProcess() for " + processName);
try {
IBPMServiceClient ibsc = getBPMServiceClient();
IProcessMetadataService service =
getBPMServiceClient().getProcessMetadataService();
IBPMContext bpmContext = getIBPMContext("weblogic", "welcome1");
List initiableTasks =
service.getInitiatableProcesses(bpmContext);
for (ProcessMetadataSummary pms : initiableTasks) {
System.out.println("++++ Process Name = " + pms.getProjectName() + "/" +
pms.getProcessName());
if (pms.getProcessName().equalsIgnoreCase(processName)) {
IInstanceManagementService ims =
ibsc.getInstanceManagementService();
Task task =
ims.createProcessInstanceTask(bpmContext, pms.getCompositeDN() +
"/" +
pms.getProcessName());
System.out.println("++++ Task title = " + task.getTitle());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void initiate() {
}
// Connect to WLS
public static BPMServiceClientFactory getBPMServiceClientFactory() {
Map properties =
new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL,
url);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
return BPMServiceClientFactory.getInstance(properties, null, null);
}
public static IBPMContext getIBPMContext(String username,
String password) throws Exception {
return getBPMServiceClientFactory().getBPMUserAuthenticationService().authenticate(username,
password.toCharArray(),
null);
}
public static IWorkflowServiceClient getIWorkflowServiceClient() {
return getBPMServiceClientFactory().getWorkflowServiceClient();
}
public static IBPMServiceClient getBPMServiceClient() {
return getBPMServiceClientFactory().getBPMServiceClient();
}
//
}
Here is the app link in Workspace
Now I want to initiate via the API.
First Kudos to Rommel Pino's post here
A great starting point -
Anyway - let's get a list of the Initiable Processes I have deployed, and then initiate the above process.
I create a project in jdev and include the following jars -
Code -
package initiatorapi;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import oracle.bpel.services.bpm.common.IBPMContext;
import oracle.bpel.services.workflow.client.IWorkflowServiceClient;
import oracle.bpel.services.workflow.client.IWorkflowServiceClientConstants;
import oracle.bpel.services.workflow.client.WorkflowServiceClientFactory;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpm.client.BPMServiceClientFactory;
import oracle.bpm.services.client.IBPMServiceClient;
import oracle.bpm.services.instancemanagement.IInstanceManagementService;
import oracle.bpm.services.processmetadata.IProcessMetadataService;
import oracle.bpm.services.processmetadata.ProcessMetadataSummary;
public class InitiableProcesses {
private static String url = "t3://localhost:7001";
public InitiableProcesses() {
super();
}
public void getInitiatiableProcesses() {
System.out.println("getInitiatiableProcesses()");
try {
IProcessMetadataService service =
getBPMServiceClient().getProcessMetadataService();
IBPMContext bpmContext = getIBPMContext("weblogic", "welcome1");
List
service.getInitiatableProcesses(bpmContext);
for (ProcessMetadataSummary pms : initiableTasks) {
System.out.println(pms.getProjectName() + "/" +
pms.getProcessName());
System.out.println("App Link " +
pms.getApplicationLinkDisplayName());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(" #################### ");
}
public void initiateProcess(String processName) {
System.out.println(" +++ initiateProcess() for " + processName);
try {
IBPMServiceClient ibsc = getBPMServiceClient();
IProcessMetadataService service =
getBPMServiceClient().getProcessMetadataService();
IBPMContext bpmContext = getIBPMContext("weblogic", "welcome1");
List
service.getInitiatableProcesses(bpmContext);
for (ProcessMetadataSummary pms : initiableTasks) {
System.out.println("++++ Process Name = " + pms.getProjectName() + "/" +
pms.getProcessName());
if (pms.getProcessName().equalsIgnoreCase(processName)) {
IInstanceManagementService ims =
ibsc.getInstanceManagementService();
Task task =
ims.createProcessInstanceTask(bpmContext, pms.getCompositeDN() +
"/" +
pms.getProcessName());
System.out.println("++++ Task title = " + task.getTitle());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void initiate() {
}
// Connect to WLS
public static BPMServiceClientFactory getBPMServiceClientFactory() {
Map
new HashMap
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL,
url);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
return BPMServiceClientFactory.getInstance(properties, null, null);
}
public static IBPMContext getIBPMContext(String username,
String password) throws Exception {
return getBPMServiceClientFactory().getBPMUserAuthenticationService().authenticate(username,
password.toCharArray(),
null);
}
public static IWorkflowServiceClient getIWorkflowServiceClient() {
return getBPMServiceClientFactory().getWorkflowServiceClient();
}
public static IBPMServiceClient getBPMServiceClient() {
return getBPMServiceClientFactory().getBPMServiceClient();
}
//
}
Test a couple of times -
I now log in to workspace as weblogic -
Now let's check the roles for this process -
Test the API with jstein/welcome1
I change the method so as to pass in user/pwd -
Re-test -
Tuesday, September 24, 2013
Subscribe to:
Posts (Atom)






