Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

what are node categories?

0 Likes
2,278

In bopf what is the use of node categories. give me some real scenarios.

4 REPLIES 4
Read only

Former Member
0 Likes
1,806

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

Read only

0 Likes
1,806

Hi Bjorn,

Thanks for your useful response above. Was wondering if I could ask a couple of follow-up questions:

  • In your example above, it seems that node categories could be used to set the "mode" for a given node row (e.g. an item in a customer invoice). If it's at that level of granularity, how can we apply a given node category to node rows at runtime? Is it via a call to modify( ) on the service manager?
  • If my assumption above is correct, is this an operation that would normally be carried out a determination? For example, for a customer invoice BO, you might have an ITEM sub-node with multiple node categories. At runtime, I'm thinking a properties determination would be used to spin through the line items and assign the appropriate node category (e.g. if it's a free item vs. normal item). Do I have that right?

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

Read only

0 Likes
1,806

Hello James, hello Narenda,

at runtime, the node category must be defined by one of the following options

  1. It is handed over by the help of io_modify while creating the instance in the implementing class of an action/ determination/validation
  2. The standard node category is taken
  3. The node class is implemented (allows to define a method to dynamically select a suitable node category for a certain instance)

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

Read only

Former Member
0 Likes
1,806

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