cancel
Showing results for 
Search instead for 
Did you mean: 

wf-batch - agent not found

former_member317781
Active Participant
0 Kudos

Hi Good day,

i have designed a workflow and in one of the methods of my Object Type is M_get_approver where i try to get the approver.

when i test the method i can able to see the Agent or Approver.

but when i Execute the workflow using SWDD i cannot get the approver instead it Passes WF-BATCH.

When in my Method if i change out the SY-UNAME and Hard code the User name ex : 999999 i get the Agent or Approver from the work flow.

can i please know how can i pass the USERID instead of hardcoding in the method?

thank you ,

J.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

The reason this happens is because background jobs in workflow run under user WF-BATCH, so that will be the value of SY-UNAME.

If you want the workflow initiator, then use that container element instead.

regards

Rick

former_member317781
Active Participant
0 Kudos

Hi Rick


I have used the container element but the results still WF-BATCH.

former_member186746
Active Contributor
0 Kudos

Hi,

in your piece of code you retrieve element Agent, I assume that in your workflow<--> task binding you pass the initiator to agent.

But then you don't do anything with the retrieved container element?

What you should do is in wf<-->task pass the initiator, then in your method read the element using swc_get_element macro, and then with this data you get the approver and with swc_set_element macro you pass this value to the exporting parameter, which should end up in your workflow (if bindings are correct).

Kind regards, Rob Dielemans

I042439
Employee
Employee
0 Kudos
former_member317781
Active Participant
0 Kudos

thank you Gupta for reply and sorry for the late response, however i have done the samething as you told but the results are same, am not getting the user email.

this is what i have done from Workflow to get the email address.

1.

i dont understand what else needs to be done.

thank you,

J.

GauthamV
Active Contributor
0 Kudos

Did you check the workflow log for container element Agent and exclude 'US' (first 2 characters)

Regards,

Gautham.

former_member317781
Active Participant
0 Kudos

thank you Gautham, but in the Workflow log I cannot see the container element Agent.

the Agent is Initial (No value in it).

it happens with other step too.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jacob,

Declare the one temporary variable and move the harding value into temporary variable,

in the method export the value when designing workflow (SWDD) create a one container variable select the import check box at properties for container.

data:agent type wfsyst-agent,

move :wa_usr21 to agent.

swc_set_element container "Agent' agent.

Regards,

Balaiah

former_member317781
Active Participant
0 Kudos

Hi Balaiah,

I have done exactly what you explained but the results still : WF-BATCH.

former_member186746
Active Contributor
0 Kudos

Hi,

If the workflow is started through an event, which is triggered by a user, then in event-->workflow binding you should bind _EVT_CREATOR to a suitable workflow container and use that one in passing it to your various methods for determining approvers.

Kind regards, Rob Dielemans