cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

workflow error:Agent assignment

former_member249671
Participant
0 Likes
1,297

Hi All,

I am running a program which uploads files from presentation server.For each uploaded file ,each workflow will be triggered using FM SAP_WAPI_START_WORKFLOW. Inside the step of a workflow,we have used Rule with responsibilities to identify an agent.From past few days whenever the program runs for multiple files ,every simultaneous workflow goes to error and in log it shows as rule unable to fetch agents.

suppose if i upload 5 files: for 1,3,5 workflow will be Inprocess and 2,4 is in error. if i run the program for each file separately,it is running successfully.I could successfully restart the error ed ones from SWPR. when I simulate the rule ,agents are showing up successfully.

This issue only occurs in Pre-production currently and doesn't show up in quality server also.

can any one advise,why error occurs for every other document even though agents are maintained correctly?

please refer attachment for error

Accepted Solutions (0)

Answers (4)

Answers (4)

I042439
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Sunil

How is the Company Code Determined in the workflow? Is it a BO Attribute (Virtual? DB?)? or Passed in Event Container? Or determined from a step in the workflow and then used in the rule in later steps.

This seems to be a timing issue that the the workflow is not able to get the company code on time (when multiple files are executed in a succession). When you debug, system gets enough time to save entries in the DB. You may see the company code in the workflow container later on (as part of the BO Attribute...if it is..... and that's because when you open the WF log, the BO code is executed again)

What does you program does? Only uploads files and pass them to workflow? Or process these files and does some postings also?

can you please detail the steps from execution of the program to triggering of the workflow to the actual point where the rule is called. We need to know the deails of everything in between.

Regards,

Modak

former_member249671
Participant
0 Likes

Basically program uploads the files ( Invoices) in the presentation server ( File path will be given at Selection-screen) and stores in documentum server and it geneartes a document number  after reading each file and saves in Ztable then eventually workflow will be triggered using SAP_WAPI_START_WORKFLOW.

Workflow has 3 condition branches before a dialog step. workflow is errored out because of agent assignment issue. but it has agents maintained and when i run in debugging mode for 2 files still it gives error. when i run the same file individually.it is working fine.

Thank you.

I042439
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Sunil

You simply repeated the issue.... but i am asking about the process.

Your rule is company code based. How is the company code determined in the workflow?

Regards,

Modak

former_member249671
Participant
0 Likes

Company code value is passed from program to container using INPUT_CONTAINER of FM SAP_WAPI_START_WORKFLOW. I could see company code value in workflow container also.

Former Member
0 Likes

If you run the same input again after removing the first file, do the same ones go into error or is it now reversed?

I042439
Product and Topic Expert
Product and Topic Expert
0 Likes

Please share the code of event trigger ...especially covering the aspect where company code is determined (from the file or DB).

Former Member
0 Likes

Hello,

This is very strange. (What's equally strange is you blacking out the number of the AC rule, but anyway...)

If you run the same file again after removing the first line, do the same ones go into error?

How are the agents determined - responsibility rule, function module?

regards

Rick

former_member249671
Participant
0 Likes

Hi Rick,

Agents are determined by rule-responsibility.Only workflow is errored out for every other file .Even I ran in debugging still the error has come for every other document.

Thank you.

StephaneBailleu
Active Contributor
0 Likes

Hi

Like Paul I would recommend using to start your workflow with an event.and the use event queue.

Cheers

Stephane

paul_bakker2
Active Contributor
0 Likes

Hi,

What are the inputs to the agent rule? Are they always available or are they time-dependent?

How many workflows are you starting at one time?

In general, it's best practice to start workflow via events rather than through a function module call. Events are better at handling high volume scenarios (eg you can space them out the event queue)

cheers

Paul

former_member249671
Participant
0 Likes

Hi Paul,

Thanks for the reply,

Input to the Rule is company code and I could see the company code in workflow container which is binded to rule container. Problem here is why the issue surfaces for every other document when the input is same. I have checked in debugging and i could see all values correctly. Only issue persists when we upload multiple files.

Its already developed workflow by some other and so,I can't change it to event now.

Thank you.

anjan_paul
Active Contributor
0 Likes

HI,

   Can you please share in details how agents are  determined with screenshot. Also share the bindings

nishantbansal91
Active Contributor
0 Likes

Hi Sunil,

Please diagnosis the problem step by step.

1. Please simulate the rule in pfac, if the rule simulation is for multiple value means your rule is correct.

2, Simulate the task. if the task is working fine it means that your task is working perfectly and binding between task and rule is also correct,

Then check the workflow binding.


Thanks

Nishant

former_member249671
Participant
0 Likes

Hi,

Binding and rule simulation shows fine. As i mentioned earlier,this issues occurs only when i upload multiple files and error happens only every other workflow. I do not see any issue with workflow. because it is working fine when I restart it again from SWPR

anjan_paul
Active Contributor
0 Likes

hI,

     It will be  good if you share your your workflow is doing with design. May be locking issues happen for  the keys from your file