📄 apihelper.java
字号:
package com.ibm.gbsc.cte.sample;
//*****************************************************************************
//* *
//* "This sample program is provided AS IS and may be used, executed, copied *
//* and modified without royalty payment by customer *
//* (a) for its own instruction and study, *
//* (b) in order to develop applications designed to run with an *
//* IBM WebSphere product, either for customer's own internal use or for *
//* redistribution by customer, as part of such an application, in *
//* customer's own products." *
//* *
//* Product 5655-FLW, *
//* (C) COPYRIGHT International Business Machines Corp., 2006 *
//* All Rights Reserved * Licensed Materials - Property of IBM *
//* *
//*****************************************************************************
//* *
//* DISCLAIMER *
//* *
//* This material contains programming source code for your consideration. *
//* These examples have not been thoroughly tested under all conditions. *
//* IBM, therefore, cannot guarantee or imply reliability, serviceability, *
//* or function of these programs. *
//* ALL PROGRAMS CONTAINED HEREIN ARE PROVIDED TO YOU "AS IS", WITHOUT ANY *
//* WARRANTIES (EXPRESS OR IMPLIED) OR SUPPORT WHATSOEVER, INCLUDING BUT *
//* NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS *
//* FOR A PARTICULAR PURPOSE. *
//* *
//*****************************************************************************
import javax.naming.InitialContext;
import com.ibm.bpe.api.BusinessFlowManager;
import com.ibm.bpe.api.BusinessFlowManagerHome;
import com.ibm.task.api.HumanTaskManager;
import com.ibm.task.api.HumanTaskManagerHome;
public class ApiHelper {
public static BusinessFlowManager initializeBFM()
throws com.ibm.bpe.api.ProcessException
{
try {
MyTrace.trace("Init business flow manager....");
// initialize context and lookup the home interface
InitialContext context = new InitialContext();
Object object = context
.lookup("com/ibm/bpe/api/BusinessFlowManagerHome");
// typecast (narrow down) the object to BusinessFlowManagerHome
BusinessFlowManagerHome bfmHome = (BusinessFlowManagerHome) javax.rmi.PortableRemoteObject
.narrow(object, BusinessFlowManagerHome.class);
// Access the remote interface for the BusinessFlowManager bean
BusinessFlowManager bfm = bfmHome.create();
MyTrace.trace("Init business flow manager successfully.");
return bfm;
} catch (javax.naming.NamingException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.bpe.api.ProcessException(null, xcpt);
} catch (javax.ejb.CreateException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.bpe.api.ProcessException(null, xcpt);
} catch (java.rmi.RemoteException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.bpe.api.ProcessException(null, xcpt);
}
}
public static HumanTaskManager initializeHTM()
throws com.ibm.task.api.TaskException
{
try {
// initialize context and lookup the home interface
InitialContext context = new InitialContext();
Object object = context
.lookup("com/ibm/task/api/HumanTaskManagerHome");
// typecast (narrow down) the object to HumanTaskManagerHome
HumanTaskManagerHome htmHome = (HumanTaskManagerHome) javax.rmi.PortableRemoteObject
.narrow(object, HumanTaskManagerHome.class);
// Access the remote interface for the HumanTaskManager bean
HumanTaskManager htm = htmHome.create();
return htm;
} catch (javax.naming.NamingException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.task.api.TaskException(null, xcpt);
} catch (javax.ejb.CreateException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.task.api.TaskException(null, xcpt);
} catch (java.rmi.RemoteException xcpt) {
xcpt.printStackTrace();
throw new com.ibm.task.api.TaskException(null, xcpt);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -