‎2015 Mar 19 10:01 AM
In bopf what is the use of node categories. give me some real scenarios.
‎2015 Mar 19 12:50 PM
Hi,
You can use node categories when for certain node instances the behavior must be different. The data model does not change but via the node category you can, for example, exclude certain determinations (or actions, associations, validations, field properties).
For example: on a free item of a customer invoice, the determination to calculate its total price (amount x item price) is not executed.
You can simply create a node category via right click on the node. In addition you must add the field
NODE_CAT_KEY TYPE /BOBF/OBM_NODE_CAT_KEY to the db table of the node.
Finish by including / excluding the actions, associations, etc using the checkboxes according to the desired behavior.
KR,
Bjorn
‎2015 Dec 07 9:20 PM
Hi Bjorn,
Thanks for your useful response above. Was wondering if I could ask a couple of follow-up questions:
Sorry if I'm off base in my line of questioning here; I'm just trying to wrap my head around the potential use cases for this. Thanks in advance for you help.
James
‎2015 Dec 08 4:09 AM
Hello James, hello Narenda,
at runtime, the node category must be defined by one of the following options
To sumarize, the setting the node category for a certain instance is only possible during the creation modification of the instance by the options (1)-(3). Later on, the node category of an instance can't be changed again. In addition this is an ordered list of options: So only if (1) is not provided, (2) is automatically chosen, if (2) is not provided, option (3) is chosen.
As described by Bjorn, you can define what kind of behavior shall be executable for instances belonging to a certain node category. For instance, a property determination may be configured for instances of category A and a different property determination may be configured to category B. However it would be possible via io_read->retrieve (ET_NODE_CAT) get the instances and their node categories to implement the property behavior in just a single determination for both categories A and B.
To also make one thing clear: Node categories are only BO internal, that means you can read them via IO_READ and you can assign an instance via IO_MODIFY however the consumer outside can't neither see or set them via the service manager.
Attention:
If you don't have already consumed node categories in your business object, I would not recommend to introduce them. At the moment (and there is no change in the near future) they are not supported in the new BOPF development environments like BOBX or BOPF in Eclipse anymore.
Regarding real word examples: Node categories are sometimes used in cases where you would use inheritance in the OO world. That means use cases you have very similar objects that however have a slightly differentbehavior, for instance having additonal actions. A real world example is a node that is called ACTIVITY and it manages different kind of activities - depending on the kind of activity, different actions are allowed to be executed.
Best regards
Tilmann
‎2015 Dec 10 9:29 AM
As usual, after Tilmann has respneded, there's not much more to say.
However, I want to empasize on
At the moment (and there is no change in the near future) they are not supported in the new BOPF development environments like BOBX or BOPF in Eclipse anymore.
In reality, you are likely to have some information in your BO node which specifies the particular behaviour (if this varies on instance-base). E. g. you can imagine a country code which influences the execution of determinations or validations. I recommend tocode to this attribute instead of intrudicing dedicated node categories. The only caveat is that you have to implement this, ideally in the check-method of each determination. Having a common superclass implementing this check-method can easily group behaviour for a particular "category".
This solution has the benefit that you can change the category at runtime.
Cheers,
Oliver