Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 1010

Re: Process Observer Discussion

$
0
0

Hi Markek,

 

first of all, sorry for the delay.

 

Now: The answer is, of course: It depends.

 

The simplest scenario is that your start object, i.e. the object of the first activity of your process, determines if you want to log the process. So let's say in your example the process starts with Create Sales Order (VA01). The object type is obviously the sales order (114). So you want to check if the related "business partner" is - let's say - a "special care customer" with special SLAs (that you want to monitor). If you have only this one start activity, the process will not be logged if the start activity is not logged.

To achieve this, you need to go into the "binding". The binding is what happens when the event/task is mapped to the activity. The default is that the task that is assigned to the activity in the process definition (POC_MODEL, view "Task Assignment") always maps to the activity. If you want to introduce a condition here, you can either create a BRFplus-rule in that view ("Create Rule") or implement BAdI POC_MAIN_TASK_BIND in enhancement spot POC_MAIN_RULES.

The example below shows you some code that will suppress the binding for process type MY_TEST if the business object ID is "NO". In your example you would use the business object ID to read the sales order and determine if the customer there is a "special care customer":

 

METHOD if_poc_process_task_binding~task_to_activity_bind_pre_bo.

    IF cs_task_act_proc_in_bind-process_type_id = 'MY_TEST' and

      cs_task_act_proc_in_bind-bo_id = 'NO'.       CLEAR cs_task_act_proc_in_bind. "no binding

   ENDIF.  

ENDMETHOD

 

As you can see, to suppress the binding, you need to clear cs_task_act_proc_in_bind. Please make sure that you don't run into performance issues here. First of all, the BAdI has a filter. You will probably want to filter on process type - in case that you have more than one process running on the machine. Make sure you're not spending too much time in your code. Reading data can be costly. This all depends on your data volume and what you do, of course, be careful and consider what is happening (use "common sense" - but that's kind of difficult with performance).

Things get more difficult, if you have multiple start activities, if you don't know from start if you need to log, if the data to determine if to log or not to log is not easily available etc. The example above describes a simple case, but it shows the basic approach, the conditional binding, to cope with that type of things.

 

Let me know if you have additional questions and how you get along.

 

Best regards, Christoph


Viewing all articles
Browse latest Browse all 1010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>