on 11-02-2007 12:18 AM
Hi,
I am trying to start a GP process from a Java EJB project using WSDL created by GP component for a particular template. I have created the deployable client proxy from the WSDL and added the reference in the EJB project.
Any idea how to use different proxy classes within the EJB project to start the process.
Thanks
Rajeev
Hello Rajeev,
You can do this. All you have to do is the following steps
1. Create your template
2. Then use the GP wsil to get the wsdl.
3. Generate the proxy off of the wsdl and u are good to go.
Hope that helps
Abdul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajeev,
i haven't done one with EJB triggerred it from webdynpro. here is a snippet that kicks of the sample time off process using api from webdynpro
IUser user = null;
IGPStructure params = null;
// Get current user
try {
IWDClientUser wdUser = WDClientUser.getCurrentUser();
user = wdUser.getSAPUser();
// obtain the Process template
IGPProcess process =
GPProcessFactory.getDesigntimeManager().getActiveTemplate(
// by specifying its ID
processId,
// and the user accessing it
user);
// obtain the Run Time Manager
IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
// create a new, empty role assignment list
IGPProcessRoleInstanceList roles = rtm.createProcesRoleInstanceList();
// get the number of roles required
int rolenum = process.getRoleInfoCount();
// iterate over the required roles
for (int i = 0; i < rolenum; i++) {
// add a new role assignment to the list
roles.createProcessRoleInstance(
// by specifying the role's unique name
process.getRoleInfo(i).getRoleName()).addUser(
// add the current user to every process role
user);
}
// Here you see how to populate parameters with data.
// This example only works, if you initiate the "Time-Off process"
// that is delivered per default with the GP Framework.
// You find it in the gallery below "Examples".
// Otherwise no parameters are initialized.
params= GPStructureFactory.getStructure(process.getInputParameters());
if (process.getTitle().equals("Time-Off Process")){
IGPStructure struc = params.addStructure("Time_off_data.1");
struc.setAttributeValue("AbsenceTypeText", "Vacation");
struc.setAttributeValue("SimulationCode",0);
struc.setAttributeValue("CompletionCode",0);
struc.setAttributeValue("PaidFlag", true);
}
// initiate the process template by passing the Process template
rtm.startProcess(process,
// a name,
"API started Process",
// a description,
"This process has been started from a WebDynpro via public API",
// the initiating user
user,
// the role assignment,
roles,
// the initial parameters
params,
// and the user actually executing this action
user);
} catch (WDUMException ex) {
logger.traceThrowableT(Severity.ERROR,
"Current user could not be resolved: ", ex);
} catch (GPInvocationException ex) {
logger.traceThrowableT(Severity.ERROR,
"Exception raised when trying to start process: ", ex);
} catch (GPEngineException ex) {
logger.traceThrowableT(Severity.ERROR,
"Exception raised when trying to start process: ", ex);
}
Hope that helps
Abdul
Thanks Abdul for your response.
The code you have provided is through GP APIs whereas I wanted to start the through web services. I believe it has to be something like this.
RoleList rl = new RoleList();
Roles role = new Roles();
Input input = new Input();
InputTypeLabel inputTypeLable = new InputTypeLabel();
try {
port.startProcess("Test process", "Test Process", role, inputTypeLable, null);
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ProcessRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchProcessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoProcessExecutePermissions e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but i am not sure how to fill the role and inputtypelable objects.
any idea, please let me know.
thanks
Rajeev
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.