cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway Workflow APPLY Decision Problem

former_member206574
Active Participant
0 Kudos

Hi,

I'm trying to configure workflow consumption but I'm facing some issue. Can anyone guide me through the basic steps?


Here I am doing Central HUB Deployment to access the business workflow through Gateway services.

Here is the workflow log to the notification I have in SBWP.

I am using ‚demoformabs‛ by using its workflow ID WS70000704. For that i got one workitem ID.

In SPRO Maintain Task Names and Decision Options, i configured workflow id and step ID as in second screen shot and decision keys as well.

When i tried to get the workflow task Collection i am getting all the workitems in the service.

/sap/opu/odata/IWWRK/WFHUBSERVICE/WorkflowTaskCollection

Response

<id>http://<host>:<port>/sap/opu/odata/IWWRK/WFHUBSERVICE/WorkflowTaskCollection('000001895997')</id>

<title type="text">WorkflowTaskCollection('000001895997')</title>

<updated>2014-06-20T06:26:19Z</updated>

<category term="WFHUBSERVICE.WorkflowTask" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="WorkflowTaskCollection('000001895997')" rel="self" title="WorkflowTask" />

<link href="WorkflowTaskCollection('000001895997')/Description" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Description" type="application/atom+xml;type=entry" title="Description" />

<link href="WorkflowTaskCollection('000001895997')/Attachments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" />

<link href="WorkflowTaskCollection('000001895997')/Comments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Comments" type="application/atom+xml;type=feed" title="Comments" />

<link href="WorkflowTaskCollection('000001895997')/ExtensibleElements" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ExtensibleElements" type="application/atom+xml;type=feed" title="ExtensibleElements" />

<link href="WorkflowTaskCollection('000001895997')/DecisionOptions" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DecisionOptions" type="application/atom+xml;type=feed" title="DecisionOptions" />

<link href="WorkflowTaskCollection('000001895997')/Participants" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Participants" type="application/atom+xml;type=feed" title="Participants" />

<link href="WorkflowTaskCollection('000001895997')/PossibleAgents" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PossibleAgents" type="application/atom+xml;type=feed" title="PossibleAgents" />

<link href="WorkflowTaskCollection('000001895997')/RelatedObjects" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RelatedObjects" type="application/atom+xml;type=feed" title="RelatedObjects" />

<link href="WorkflowTaskCollection('000001895997')/$links/Description" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/Description" type="application/xml" title="Description" />

<link href="WorkflowTaskCollection('000001895997')/$links/Attachments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/Attachments" type="application/xml" title="Attachments" />

<link href="WorkflowTaskCollection('000001895997')/$links/Comments" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/Comments" type="application/xml" title="Comments" />

<link href="WorkflowTaskCollection('000001895997')/$links/ExtensibleElements" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/ExtensibleElements" type="application/xml" title="ExtensibleElements" />

<link href="WorkflowTaskCollection('000001895997')/$links/DecisionOptions" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/DecisionOptions" type="application/xml" title="DecisionOptions" />

<link href="WorkflowTaskCollection('000001895997')/$links/Participants" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/Participants" type="application/xml" title="Participants" />

<link href="WorkflowTaskCollection('000001895997')/$links/PossibleAgents" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/PossibleAgents" type="application/xml" title="PossibleAgents" />

<link href="WorkflowTaskCollection('000001895997')/$links/RelatedObjects" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/RelatedObjects" type="application/xml" title="RelatedObjects" />

<content type="application/octet-stream" src="WorkflowTaskCollection('000001895997')/$value" />

- <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:workitem_id>000001895997</d:workitem_id>

<d:status>STARTED</d:status>

<d:status_txt>In Process</d:status_txt>


Now i am doing POST Operation  Apply Decision Functionality for Decision Handling for this work item, I implemented the Badi for this. /IWWRK/ES_WF_WI_BEFORE_UPD_IB

Query: /sap/opu/odata/IWWRK/WFHUBSERVICE/ApplyDecision?workitem_id='000001895997'&dec_key='0001'&comments='Approved Absence Request'

STATUS is 200, But

The Response is

<id>http://<host>:<port>/sap/opu/odata/IWWRK/WFHUBSERVICE/ActionResultCollection('1')</id>

<title type="text">ActionResultCollection('1')</title>

<updated>2014-06-20T06:20:34Z</updated>

<category term="WFHUBSERVICE.ActionResult" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ActionResultCollection('1')" rel="self" title="ActionResult" />

- <content type="application/xml">

- <m:properties>

<d:result_code>1</d:result_code>

<d:reason>Work item 000001895995 cannot be read</d:reason>

</m:properties>

</content>

</entry>


Here I am applying decison on Workitem id 000001895997, but it is showing Work item 000001895995 cannot be read..

Please check the First SCreen shot for the log.


Help me in this to resolve.



Accepted Solutions (0)

Answers (4)

Answers (4)

vishnucta
Active Participant
0 Kudos

me too having the same issue.

Regars,

Vishnu

Former Member
0 Kudos

Hi

You need to check the SAP account used when you execute the service. The WFHUBSERVICE uses the logon used and it can only execute the item when the workitem belongs to the ID used in the call. I have encountered the same issue and I was able to resolve it by making sure that the call was done by the user with the item assigned to that user. Or you can reassign the task to the user that you use when running the service.

Regards,

Ray

Former Member
0 Kudos

Hi VENU G,

i got the same issue as you explained. i'm using the wfhubservice as well. before updating the gateway to from sp06 to sp08 everything works fine.

any solutions until now?

thank you.

Danilo.

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Please refer this discussion on similar issue.

Regards,

Chandra

former_member206574
Active Participant
0 Kudos

Hi Chandra,

I already tried all the steps as in the discussion. but not able to resolve the issue.

Regards,

Venu

Former Member
0 Kudos

Hi Venu ,

The same issue I have faced, yes it's correct only ..

First read all the workitems using workflow collection , then filter the workflow item which is created recently and apply decision on that item id..

While creating workflow in swdd it will show some id and while trying to execute system will show different id.

So, after creating a new task in demoformabs, execute the get query on wokflowtask collection, then copy the recent work item and execute the apply decision .

this will help for sure .

Regards,

Lokeswar.

former_member206574
Active Participant
0 Kudos

Hi Lokeswar,,

Do you implement any BADI for decision Handling. If Yes, i am not able to trigger the debugging point in BAdi Code. I did as u mentioned, but no luck. Still the error is getting to me Work item 000001895995 cannot be read.

could you please help. Here i am using WFHUBSERVICE ...

Regards,

Venu

Former Member
0 Kudos

Hi Venu,

whenever a new workflow task started , system will create a task will new workitem id, you have to find teh exact work item id and execute the apply decision on that task,

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Have you also implemented BAdI /IWWRK/ES_WF_CUST_EXT_IB apart from /IWWRK/ES_WF_WI_BEFORE_UPD_IB as mentioned in http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/509c922a-aa9a-2f10-328c-d3814560d...

I tried to approve workitem in my system and was able to do it successfully. I got below success message and workitem got deleted from my inbox (SBWP)

Regards,

Chandra

former_member206574
Active Participant
0 Kudos

Hi Chandra,

I implemented both the badis as per the document you mentioned.

Query :

/sap/opu/odata/IWWRK/WFHUBSERVICE/ApplyDecision?workitem_id='000001895997'&dec_key='0001'&comments='Approved Absence Request'


STATUS is 200, But


The Response is

<id>http://<host>:<port>/sap/opu/odata/IWWRK/WFHUBSERVICE/ActionResultCollection('1')</id>

<title type="text">ActionResultCollection('1')</title>

<updated>2014-06-20T06:20:34Z</updated>

<category term="WFHUBSERVICE.ActionResult"scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ActionResultCollection('1')" rel="self" title="ActionResult" />

- <content type="application/xml">

- <m:properties>

<d:result_code>1</d:result_code>

<d:reason>Work item 000001895995 cannot be read</d:reason>

</m:properties>

</content>

</entry>


Here I am applying decison on Workitem id 000001895997, but it is showingWork item 000001895995 cannot be read..

Please check the First SCreen shot for the log.










When i created the workflow it shows the workitem id 1895995 is created. but the step id for absence approve is 48, so i used workitem id 1895997 for apply decision.


When i try to apply decision on workitem id 1895995, got error


<?xml version="1.0" encoding="utf-8" ?>

- <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code>SY/530</code>

<message xml:lang="en">You have no access to item 000001895995</message>

- <innererror>

<transactionid>8B2CFCE31EC4F181845774867AD9B9E0</transactionid>

<timestamp />

- <Error_Resolution>

<SAP_Transaction />

<SAP_Note />

</Error_Resolution>

- <errordetails>

- <errordetail>

<code />

<message>You have no access to item 000001895995</message>

<propertyref />

<severity>error</severity>

</errordetail>

- <errordetail>

<code>/IWBEP/CX_MGW_BUSI_EXCEPTION</code>

<message>You have no access to item 000001895995.</message>

<propertyref />

<severity>error</severity>

</errordetail>

</errordetails>

</innererror>

</error>


Could you please check could be the reason for this error.


Thanks,

Venu








former_member206574
Active Participant
0 Kudos

Hi Chandra,

We have to implement both the BAdis in BACKEND system only Ryt?

Regards,

Venu

ChandraMahajan
Active Contributor
0 Kudos

Yes we need to implement both BAdI's

Regards,

Chandra

former_member206574
Active Participant
0 Kudos

Hi chandra,

I implemented both the badis in the backend. but in response of apply decision getting error as shown above .

Regards,

Venu