cancel
Showing results for 
Search instead for 
Did you mean: 

Workflows : Rule Problem

Former Member
0 Kudos

Hi,

I got a tricky problem in Rules. I created a rule and tested it thoroughly.It's working perfect. We transported the request. And in production also, it is working fine. But suddenly yesterday, we got some peculiar issue. The rule is returning a different value which is not related to the logic itself. Immediately I tested my rule manually, but I got the expected result which is different from the achieved result. I dont know how the pecularity comes. Why the results are different in these cases? When I simulate the rule manually the result is perfect, but when the rule is runned through Workflows, the result is wrong sometimes.

Why is the difference in behavior. And that too, this difference exists only for few times. It's troubling in all the cases. Sometimes the rule is working perfect. Sometimes, it is not working as expected.

There is no problem with Business Logic. And in fact I checked with the Binding also. There is no problem with Binding too.

Can anyone help me out?

Regards,

Raja Sekhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Provide brief details on the rule, if this is still an issue.

Virendra.

Former Member
0 Kudos

Hi Virendra,

Here are the RULE Details.

The rule is used to determine the FINANCE Head , which is maintained in a ZTable.

We pass ONE Personnel Area container element from the Workflow to Task container. And inside the Rule(Function module) we had defined single SELECT query to retrieve the needed Finance Head based on the Personnel Area.

That's all.

I dont know how it works perfectly when we simulate the same rule in PROD, with that instance's data.

Something wrong.

Raja

Former Member
0 Kudos

Hi Ramki and Virenda,

I got one small clarification.

Suppose, if a rule doesnt determine any AGENT, then what will be the case?

Will the flow stops @ that point due to "NO AGENT FOUND" problem? Or does it pick any Agent randomly from the Workflow Buffer and set it as an agent.

Which one will happen?

Regards,

Raja Sekhar

Former Member
0 Kudos

There will be no random pick of an agent. What happens is that the rule behaves either with setting the workitem to error or if this is not flagged then the workitem is put in the inbox of all possible agents of the task.

Can you paste your code of the rule, maybe something wrong there.

Former Member
0 Kudos

What is the container data for the failed workflow just before this step is processed ? Does this have the correct "Personnel Area" ?

Also verify the variables in rule container binding both at design and run-time.

You can default a Finance area user /Workflow admin if the Personnnel Area is initial or the select query does not return a valid user inside the rule.

ramki_maley
Active Contributor
0 Kudos

Hi,

Authorizations may not be an issue in your case since you are reading a custom table. Ensure that the values you are supplying in your test are the same as what WF runtime is actually supplying to the rule.

When you have a custom rule you must have a strategy when no agent is found. In our case we let the work item error out and constantly monitor WIs without agents and take corrective action.

Also, In the rule FM make sure the Actor_Tab is <b>REFRESH</b>ed and <b>CLEAR</b>ed if no agent is found and populated with a default agent if that is your strategy.

Cheers,

Ramki Maley.

Former Member
0 Kudos

Yah Ramki,

I did the same. Like I used the REFRESH and CLEAR ACTOR_TAB if there is no agent found. And I also did the same when I entered into the FM.

Yes, I implemented the above mentioned strategy just now. And now I got to test the rule thoroughly and send it QAS and test it again and them implement the same in PRODUCTION. Yah, I was not aware of this point,when I designed my own rule. Here by I will be careful with RULES.

Data is passing to the FUNCTION MODULE perfectly.

Thanks Ramki.

Regards,

Raja Sekhar

Former Member
0 Kudos

Yah Virendra,

The Container Data is getting passed well. I verified the same with the RUNTIME DATA.

Well, I got to make a STRATEGY in future that whenever a custom rule doesnt return an AGENT, then I got to set a DEFAULT USER as WORKFLOW ADMIN who recieves these Work Items as you said.It's really a very good practice.

Thanks for the information about the RULES. It will really help me out when designing rules in future. I will be careful in FUTURE.

Regards,

Raja Sekhar

Former Member
0 Kudos

Yah Peter,

I was expecting this answer. I had observed the same in my own WF's. I used to get mazed, why the same WORK ITEM is going to more than one PERSON. Then I got this doubt and posted the same in this groups.

This is really a very good point which would be helpful for me in future.

Thanks Peter.

Regards,

Raja Sekhar

Answers (1)

Answers (1)

ramki_maley
Active Contributor
0 Kudos

Never heard of this behaviour and and it is not possible. It is just a few lines of code operating on some data. I suggest try to test your rule in production by by pasting the Rule Container Elements directly from the Workflow log.

BTW, what type of rule is it?

Cheers,

Ramki Maley.

Former Member
0 Kudos

Yes Ramki,

I too came through for the first time.

Yah, I did the same as you said, but the correct result is coming.I simulated the same rule in Production with Rule container elements in the workflow log, and I got the expected result. When I saw the workflow log, the result of this rule is wrong.

Coming to the rule, We had a single SELECT query that determines the Finance head which is maintained in a ZTable.

I dont know what sought of problem it is...Am very much tensed.

Regards,

Raja Sekhar