cancel
Showing results for 
Search instead for 
Did you mean: 

Material Workflow with terminating events

0 Kudos


Hi ,

I have created new custom workflow for material master and business object is BUS1001006.

Workflow functionality is that when user changes MRP fields WF should trigger and it will go to Approvals once we get all the required approval we are applying the MRP changes to MAterial. Here Approval step is using custom screen, so we are completing approval step using terminating events.

Issue is that let say, user has changesd the ABC material with plant 4012, now WF triggers and when user again chnages the ABC Material with plant 4013 another WF triggered. Now when First WF approved, the other ther WF is also getting approved. becasue in terminating events we are receiving a business object of type BUS1001006 in this only material is key field.

Can you please suggest, how should I proceed and we are using this workflow from last 2 years, just now we have identified this issue.

Regards,

Santosh.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi ,

Please let me know, I can do in this way for the issue..

Here, can I change business object method from asychronous to synchronous and I will capture user decissions("Approve", "Reject"  ) from function module export parameters. ?

Regards,

Santosh.

0 Kudos

can any one please help me..this is little critical

Thanks,

Santosh.

former_member185167
Active Contributor
0 Kudos

Hello,

As suggested above, you would be better off creating a new BOR (or class) with Plant included in the key. if you don't want to do that then you could supply Plant as a parameter.

None of this has anything to do with passing Approve or Reject as an event parameter, why would you do that? Just use different events.

regards

Rick Bakker

Former Member
0 Kudos

I have no idea what you are doing now (is this even related to the original question?).

In general you don't change business object methods (or any standard objects) - you should create a new method. There is a standard procedure how to add additional functionality (attributes, methods etc.) to standard business object.

Regards,

Karri

Former Member
0 Kudos

Hi,

In your situation BUS1001006 is not and has never been sufficient - just like you have now learned. You should have used another business object or created a new one that has a "more accurate" key including the plant.


How to fix the situation:

Doing some bigger changes to the business object is most likely out of question. First of all I would take a closer look to the code that triggers the events. Could you for example add a new parameter "plant" to the event? This way the workflow would get the information about for which plant the event was triggered, and you could do some additional checks (compare the plants) in the workflow whether the workflow can end or not. The task/work item gets completed, but at least you could direct a new one back to the agent with a loop.

Whatever you do, be very careful about what the changes will do for the existing workflow instances (the ones that are already running). If you do some bigger changes to the task, you must understand that the tasks don't have versions, and if the changed task is somehow incompatible with the existing solution, you might run into big problems.

Regards,

Karri

0 Kudos

Hi Karri,

Thank you for your repply.

Can you please confirm my understanding on the above point you have mentioned.

As you said I want to add a new parameter "Plant "in the event and in step having this asychronous method, in binding I will pass one more parameter, in addition to _evt_object i.e. plant and I will receive this into new variable in task container and after this I will compare the plant we received from event and plant that is already exist in task log in work item "conditions tab->complete work item".

One more thing , to add a new paramer in event, do I have to create a attribute(Plant) in business object ?

Regards,

Santosh.

Former Member
0 Kudos

I think you have pretty much understood it correctly. Well, actually I am not so sure if the "Conditions" will work as you are planning (you don't have access to the task container (for comparing the plants) and even if you had, the solution won't work in "real time" - conditions are checked every 3 minutes or so). This is actually the difficult part of the whole thing. You might need to let the work item to get completed, and then perhaps create a new approval work item (with the help of a loop). I cannot think any (at least not any easy way) to prevent the work item to get completed with the terminating event.

Perhaps someone can present you a better solution?

>One more thing , to add a new paramer in event, do I have to create a attribute(Plant) in business object ?

No, and you should not add it. The object represents the material, which can have plant data maintained for many plants - so which one would you choose? I would just add the plant to the event parameter. 

Regards,

Karri

former_member185167
Active Contributor
0 Kudos

Hello,

I don't know this BOR but this thread seems to suggest that you *can* add a plant as an attribute:

If it's not the case (or if the attribute would have to be multiline) then I see no other option than to pass the Plant as a parameter. Then again you could try creating a new BOR which has both keys combined and use that instead, it's a purer solution.

regards

Rick Bakker

0 Kudos

Hi Bakker,

Thanks for your repply.

In my case we have only one plant, if I create plant as attribute, can we have unique key while binding between terminating event asd task.

Regards,

Santosh.