on 06-09-2008 5:55 AM
Hi,
I want to call workflow when i click on submit button. Please specify which function module i have to call for that . Please provide code if possible.
Regards,
Gurprit Bhatia
Hi,
I was used following FM to trigger the workflow in my customise BAPI.
call function 'SWE_EVENT_CREATE'
exporting
objtype = 'ZXXXX
objkey = object_key
event = 'CREATED'
importing
event_id = eventid
tables
event_container = event_container
exceptions
objtype_not_found = 1
others = 2.
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi GURPRIT ,
Use the following code to start GP work flow
from webdynpro application
IGPProcess process = null;
String message = "";
String processName = "Demo Process"; // process name given to process in GP Design Time
try {
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
process =GPProcessFactory.getDesigntimeManager().getActiveTemplate("991EC21028BE11DD82C000144F6ABEA8",userContext); // process Id , Copy it from GP Design Time
IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
int rolenum = process.getRoleInfoCount();
IGPProcessRoleInstance roleInstance=null;
IGPStructure params = null;
params = GPStructureFactory.getStructure(process.getInputParameters());
if (process.getTitle().equals("Demo Process"))
{
params.setAttributeValue("Attribute 1 name",Attribute 1 value);
params.setAttributeValue("Attribute 2 name",Attribute 2 value);
params.setAttributeValue("Attribute n name",Attribute n value);
params.setAttributeValue("I_ActionName_Appr","Please Approve Travel Request: "+wdContext.currentContextElement().getTripNo());
IGPProcessInstance prInstance = rtm.startProcess(process,processName,"This process has been started using the GP public API",user,roles,params,user);
}
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportSuccess("Exception Main Try Block "+e.getMessage());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.