Search:     Advanced search

MBO Constants

Article ID: 96
Last updated: 19 Feb, 2009
Add comment
Views: 46646
Comments: 5
Posted: 01 Feb, 2009
by: Giguere E.
Updated: 19 Feb, 2009
by: MaximoKB A.

MBO Constants

In the code examples and Maximo code, we can find all strange long values like 7L, 11L, used in the setValue calls. These contants affects the behavior of the attribute in Maximo.

But, it is a very bad coding habit to use numeric values directly in the code. For this purpose, Maximo exposes in its API all the necessary constants. These can be found in both the Mbo class and the MboConstants interface.

The following table shows the numerical values for most of these commonly used contants:

Constant name Description Value
NOADD 1
NOUPDATE Can the object be changed. This is the same as the READONLY flag 2
NODELETE Cannot be deleted 4
NOSAVE Cannot be saved 8
NO_RELATEDMBOS_OF_OWNERSCHILDREN_FETCH Internal bit for allowing only one level of related mbos of owner children access 16
READONLY 7
DISCARDABLE Bit for discardable mbos. Discardable mbos are always read-only. If a Mbo set is marked as DISCARDABLE, then the mbo set does not cache the mbos as it fetches from the database. 39
REQUIRED Required attribute 8
SAMEVALUEVALIDATION Bit for Same value validation. setValue() call with the same value causes validation to occur, if this flag is set 16
USER Bits upwards from this value can be used for user defined purposes 256
NOVALIDATION Used to suppress validation of a field 1
NOACCESSCHECK Suppress access control checks 2
DELAYVALIDATION Delay validation 4
NOACTION Used to suppress action of a field 8
NOVALIDATION_AND_NOACTION Used to suppress validation and action 9
NOSETVALUE Similar to the READONLY, except that no exception is thrown and the setValue() calls are suppressed. Used as an internal flag to prevent setValue() calls on field values set with DELAYVALIDATION flag 32
CHANGEDBY_USER Used to indicate that the user has changed a field from the user interface. 16
NONE General value used to denote no value 0
NOCOMMIT Constant to indicate whether to commit to the database as part of the save or not. 2

The following Java code can be used in almost any class to extract Constant values that are either not documented or not accessible.

...
 
 
debug("NOADD = " + Mbo.NOADD);
debug("NOUPDATE = " + Mbo.NOUPDATE);
debug("NODELETE = " + Mbo.NODELETE);
debug("NOSAVE = " + Mbo.NOSAVE);
debug("NO_RELATEDMBOS_OF_OWNERSCHILDRENFETCH = " + Mbo.NO_RELATEDMBOS_OF_OWNERSCHILDREN_FETCH);
debug("READONLY = " +Mbo.READONLY);
debug("DISCARDABLE = " + Mbo.DISCARDABLE);
debug("REQUIRED = " + Mbo.REQUIRED);
debug("SAMEVALUEVALIDATION = " + Mbo.SAMEVALUEVALIDATION);
debug("USER = " + Mbo.USER);
debug("NOVALIDATION = " + Mbo.NOVALIDATION);
debug("NOACCESSCHECK = " + Mbo.NOACCESSCHECK);
debug("DELAYVALIDATION" + Mbo.DELAYVALIDATION);
debug("NOACTION = " + Mbo.NOACTION);
debug("NOVALICATION_AND_NOACTION = " + Mbo.NOVALIDATION_AND_NOACTION);
debug("NOSETVALUE = " + Mbo.NOSETVALUE);
debug("CHANGEBY_USER = " + Mbo.CHANGEDBY_USER);
debug("NONE = " + Mbo.NONE);
debug("NOCOMMIT = " + Mbo.NOCOMMIT);
 

Added By: Eric Giguere

This article was:   Helpful | Not Helpful

 

Add comment

Also listed in
folder Articles By Contributors -> Eric Giguere

Prev   Next
Creating Child MBO     Main Maximo 6 Framework Classes

Showing: 1-5 of 5  
Comments
syed ather mehdi | 26 Apr, 2009 02:45 PM
Hello, Thanks for your valuable information. But you didnt tell anything about 11L value.what is 11L then.
Sudhanshu Goel | 03 Aug, 2009 04:25 AM
11L stands for NOACCESSCHECK | NOVALIDATION_AND_NOACTION
shaik | 31 May, 2010 09:47 AM
Values like 1,2,4,8, and 16 are repeated. These values are wrong. please look into the java docs under --> /psdi/mbo/MboConstants.html. There it is clearly mentioned what is what.
leon | 07 Dec, 2011 01:34 AM
11L = 1L + 2L + 8L stands for NOVALIDATION + NOACCESSCHECK + NOACTION
Nitika | 10 Nov, 2014 01:01 AM
Do we have a flag in maximo to make a field visible/invisible

Prev   Next
Creating Child MBO     Main Maximo 6 Framework Classes

RSS

Welcome to the Maximo KB Site

Powered by www.maximokb.com