Skip to Content
0
Jul 31, 2012 at 01:46 PM

Webservice call (with Rule Resolution Result) as soon as the Workitem is Created

28 Views

Hi Experts,

My Scenario:

In the workflow in question, as soon as a Workflow Instance is created, after a few background steps, the First Workitem (Human Activity) is created.

Now, as soon as this workitem is created and before it gets Opened/Reserved, I need to figure-out the agents (result of the rule resolution) and send this result to SharePoint as a Web Service call.

I am using Program Exits (Method Event Raised) to Achieve this Functonality.

Method - IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED.

*After Data Declaration

break-point.

CASE

im_event_name.

WHEN if_swf_ifs_workitem_exit~c_evttyp_after_create.

CALL

METHOD

IM_WORKITEM_CONTEXT->GET_RULE_RESULT
RECEIVING
RE_AGENTS = rule_result.

CALL

FUNCTION 'ZDUET_TASKINFO_WS_CALL'
EXPORTING
TASKID = l_pos_wiid
PROJECTID = li_initialparams-vproj
REGCODE = wa_reg_dat-regcode
DOCUMENT_STATUS = '1'
PROJECT_YEAR = li_initialparams-ivarappy
PROJECT_VERSION = '0'

BUDGET_UNIT = li_initialparams-budget_unit
BUDGET_UNIT_NAME = li_initialparams-BU_NAME
FLAG = 'X'
TABLES
SP_AGENTS = rule_result
.

commit work.

Questions:

1) As soon as the Workitem is created, my break-point statement doesnt work and I am not able to debug. But as soon as the workItem is created and I open it, I am able to go into Program Exit but with different event name (status change). Is c_evttyp_after_create event right place for making this WS Call?

also, I am not able to understand why my break point doesnt work immediately the workitem is created?



2) I have tried to put the Rule Resolution Code in the same method in following event. can I use following event in my scenario? When does it gets triggered in event flow? c_evttyp_after_rule_exec