Decision Center API

ilog.rules.teamserver.web.beans
Class ManagerBean

java.lang.Object
  extended by ilog.rules.teamserver.web.beans.ManagerBean
All Implemented Interfaces:
ilog.rules.teamserver.web.IlrConstants, Serializable, EventListener, javax.servlet.http.HttpSessionBindingListener

public class ManagerBean
extends Object
implements ilog.rules.teamserver.web.IlrConstants, Serializable, javax.servlet.http.HttpSessionBindingListener

ManagerBean is the main entry point for a Decision Center web application.

Overview

ManagerBean manages the connection to Decision Center. Two Decision Center sessions are associated to this bean, one for general use, the other one for RuleApp generation.

You retrieve the instance of this bean in the current HTTP session either in Java by calling getInstance() or as a JSF EL expression.

Code examples

The following JSP code example shows how to display a command link for the Decision Center administrator only:

 <h:commandLink value="Click me" action="MyBackingBean#myAction" rendered="#{ManagerBean.administrator}"/>
 
The following Java code example shows how reset the owner field of a rule using a ManagerBean instance:
 public static void resetOwner(IlrElementDetails ruleDetails) throws IlrObjectNotFoundException, IlrInvalidElementException, IlrKnownUUIDException, IlrObjectLockedException, IlrFolderLockedException, IlrPermissionException {
        ManagerBean bean = ManagerBean.getInstance();
        IlrSession session = bean.getSession();
        // Set the processInstance. Notice that the status is an extended property.
        ruleDetails.setRawValueNoCheck((EAttribute) session.getModelInfo().getElementFromFQN("brm.BusinessRule.owner"), null);
        IlrCommitableObject cObj = new IlrCommitableObject(ruleDetails);
        cObj.setRootDetails(ruleDetails);
        session.commit(cObj);
 }
 

See Also:
Serialized Form

Field Summary
protected static String COMPLETE
           
 
Fields inherited from interface ilog.rules.teamserver.web.IlrConstants
ACTIVE, ADDED_STYLE_CLASS, AGGREGATE_TITLE_CLASS, ALLOW_COOKIE_PERSISTENCE, ANY_CLASS, AUTO_POPULATE, AUTO_POPULATE_AGGREGATES, AUTO_POPULATE_EXTENDED, AUTO_POPULATE_PREVIEW, BASELINE, CAUSE, CHANGED_STYLE_CLASS, COLS, COLUMN_CLASSES, COLUMN_IDS, COLUMN_WIDTHS, COMMITABLEOBJECT, DATA, DATA1, DATA2, DATASOURCE_COOKIE, DESCRIPTION, DESCRIPTION_STYLE_CLASS, DIRECTION, ECLASS, EDITOR_IDENTIFIER, ELEMENT, ELEMENT_DETAILS_CLASS, ELEMENT_TYPE, ELEMENT_VERSION, ELEMENTS, EMPTY_DEFINITION, EMPTY_LIST_MESSAGE, EMPTY_STYLE_CLASS, ENABLED, EVEN_ROW_CLASS, FAILURE_STYLE_CLASS, FIELD_CLASS, GLOBAL_STYLE_CLASS, GROUP_CLASS, HEADER_CLASS, HIDE_TOOLBAR, HREF, HTML_DATA, HYPER_LINK_CLASS, ICON, ICON_RENDERED, ICON_STYLE_CLASS, KPI_CLASSNAME, KPI_RESULT_CLASSNAME, LANGUAGEPATH, LEFT_COLUMN_CLASS, LOCK_PANEL_CLASS, LOCK_WHEN_EDITING, MAX_TEXT_LENGTH, MESSAGE, MODE, MODE_VIEWER, MODEL, NONE_CLASS, ODD_ROW_CLASS, ONCLICK, PASSWORD_COOKIE, PERSISTENT, PROP_NAME_VISIBLE, PROPERTY_COLUMN_CLASS, RECURSIVE, REMEMBERME_COOKIE, REMOVED_STYLE_CLASS, RENDERED, RIGHT_COLUMN_CLASS, ROWS, SELECTABLE_TYPE, SELECTED_CLASS, SELECTED_ELEMENT, SELECTED_STYLE_CLASS, SELECTOR_CLASS, SESSION_FACTORY, SHOW_STACK, STACK, STEPS_CLASS, STYLE_CLASS, SUCCESS, SUCCESS_STYLE_CLASS, TABLE_CLASS, TARGET, TEXT_VIEW, TITLE, TITLE_RENDERED, TOOLTIP, TYPE_CLASS, UNCHANGED_STYLE_CLASS, UNSELECTED_CLASS, USERNAME_COOKIE, VALUE, VALUE_COLUMN_CLASS, WIDTH
 
Method Summary
 IlrElementHandle commit(IlrCommitableObject cobject)
          Commits an element and notifies the console so that the tree and table in the explore view can reflect the change.
 String confirmSelection()
           
 String getAccessToken()
           
 List<Locale> getAvailableLocales()
          Gets the list of available locales in the Decision Center console.
 IlrTreeController getCurrentTreeController()
           
static String getDetailsURL(IlrElementHandle handle)
          Deprecated. replaced by getPermanentLinkHelper()
 List<IlrElementSummary> getDisplayElements()
          Gets the currently displayed elements in the table.
 String getIconPath()
           
static ManagerBean getInstance()
          Retrieves the instance of the manager for this HTTP session.
 Locale getLocale()
          Gets the locale of the Decision Center console.
 String getLocaleDir()
           
static IlxWPort getOrCreateAndOpenCurrentPort()
          Gets or creates the current web component port and opens it if not already done.
 IlrPermanentLinkHelper getPermanentLinkHelper()
          Gets the permanent link helper for this bean.
 IlrElementDetails getSelectedElement()
          Gets the element currently selected in the console.
 List getSelectedElementsInTable()
          Returns the list of elements currently selected in the current displayed element table (Explore or Query tab).
 IlrSession getSession()
          Gets the Decision Center session.
 String getUsername()
          Gets the current user name, that is, the name given by the user at sign in.
 String getWorkOnProjectValue()
           
 boolean isActivityActive()
           
 boolean isAdministrator()
          Indicates whether the current user has the rtsAdministrator role.
 boolean isAuthenticated()
           
 boolean isBusinessSpaceContext()
           
 boolean isConfigManager()
          Indicates whether the current user has the rtsConfigManager role.
 boolean isConnected()
          Checks if the manager sessions are connected to Decision Center.
 boolean isDecisionServiceOpened()
          Indicates whether a project is currently open in the web console.
 boolean isDotNetProject()
           
 boolean isInstalled()
          Indicates whether Decision Center has been installed, that is, whether the database tables have been created.
 boolean isInstalledAndInitialized()
          Indicates whether Decision Center has been installed and initialized, that is, whether the database tables have been created and the metamodel uploaded.
 boolean isInstaller()
          Indicates whether the current user has the rtsInstaller role.
 boolean isProjectModeInit()
           
 boolean isProjectOpened()
          Indicates whether a project is currently open in the web console.
 boolean isReleaseActive()
           
 boolean isUserInRole(String role)
          Indicates whether the user has the given role.
 boolean isWorkOnProject()
           
 String noItemSelectedSingle()
          Error message helper.
 void saveAsLastBaseline(IlrBaseline baseline)
           
protected  IlrBaseline setInitialProject()
           
 void setIsAccessible(Boolean isAccessible)
           
 void setProjectModeInit(boolean init)
           
 void setWorkingBaseline(IlrBaseline baseline)
          Sets the working baseline for the current session and notifies the console of the change.
 void setWorkingRelease(IlrBaseline baseline)
          Sets the working release for the current session and notifies the console of the change.
 void setWorkOnProjectValue(String newValue)
           
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
           
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPLETE

protected static final String COMPLETE
See Also:
Constant Field Values
Method Detail

isConnected

public boolean isConnected()
Checks if the manager sessions are connected to Decision Center.

The manager bean attempts to connect to the manager sessions the first time a Decision Center JSP page is displayed. If the connection fails for any reason, this method returns false.

Returns:
If both managers session are connected, true is returned.
See Also:
IlrSessionFactory.connect(String, String, String, String)

getSession

public IlrSession getSession()
Gets the Decision Center session.

Returns:
An IlrSession, or null if no connection has been attempted so far.

isProjectOpened

public boolean isProjectOpened()
Indicates whether a project is currently open in the web console.

Returns:
true If a project is open in the web console.

isDecisionServiceOpened

public boolean isDecisionServiceOpened()
Indicates whether a project is currently open in the web console.

Returns:
true If a project is open in the web console.

getAvailableLocales

public List<Locale> getAvailableLocales()
Gets the list of available locales in the Decision Center console.

This list can be seen in the Options / Display Options page of the console.

Returns:
A list of java.util.Locale objects.

getLocaleDir

public String getLocaleDir()

getLocale

public Locale getLocale()
Gets the locale of the Decision Center console.

This locale is found in the Decision Center preferences of the connected user. If it is not found, then the locale is taken from the URL request passed to Decision Center (for example, http://localhost:9080/teamserver?locale=en). If it is not specified in the URL, then the locale used is the locale of the browser, provided that this locale is part of the available locales.

Returns:
A Locale object.
See Also:
getAvailableLocales()

setIsAccessible

public void setIsAccessible(Boolean isAccessible)

getAccessToken

public String getAccessToken()

getUsername

public String getUsername()
Gets the current user name, that is, the name given by the user at sign in.

Returns:
The name of the user.

isAuthenticated

public boolean isAuthenticated()

setWorkingBaseline

public void setWorkingBaseline(IlrBaseline baseline)
                        throws IlrApplicationException
Sets the working baseline for the current session and notifies the console of the change.

If you want to change the working baseline by API, you should use this method instead of IlrSession.setWorkingBaseline(ilog.rules.teamserver.brm.IlrBaseline), because this will notify the console and allow it to update accordingly the next time it is displayed.

Throws:
IlrApplicationException
See Also:
getSession()

setWorkingRelease

public void setWorkingRelease(IlrBaseline baseline)
                       throws IlrApplicationException
Sets the working release for the current session and notifies the console of the change.

If you want to change the working release by API, you should use this method instead of IlrSession.setWorkingBaseline(ilog.rules.teamserver.brm.IlrBaseline), because this will notify the console and allow it to update accordingly the next time it is displayed.

Throws:
IlrApplicationException
See Also:
getSession()

isDotNetProject

public boolean isDotNetProject()

isBusinessSpaceContext

public boolean isBusinessSpaceContext()

setInitialProject

protected IlrBaseline setInitialProject()
                                 throws IlrApplicationException
Throws:
IlrApplicationException

commit

public IlrElementHandle commit(IlrCommitableObject cobject)
                        throws IlrApplicationException
Commits an element and notifies the console so that the tree and table in the explore view can reflect the change.

Throws:
IlrApplicationException
Parameters:
cobject - The element to commit.
Returns:
Handle of the committed element.

getInstance

public static ManagerBean getInstance()
Retrieves the instance of the manager for this HTTP session.

Returns:
The bean instance.

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

isAdministrator

public boolean isAdministrator()
Indicates whether the current user has the rtsAdministrator role.


isConfigManager

public boolean isConfigManager()
Indicates whether the current user has the rtsConfigManager role.


isUserInRole

public boolean isUserInRole(String role)
Indicates whether the user has the given role.

Parameters:
role - The role to test.
Returns:
true if the user has the given role.

getIconPath

public String getIconPath()

isInstalled

public boolean isInstalled()
Indicates whether Decision Center has been installed, that is, whether the database tables have been created.


isInstalledAndInitialized

public boolean isInstalledAndInitialized()
Indicates whether Decision Center has been installed and initialized, that is, whether the database tables have been created and the metamodel uploaded.


isInstaller

public boolean isInstaller()
Indicates whether the current user has the rtsInstaller role.


getDetailsURL

public static String getDetailsURL(IlrElementHandle handle)
Deprecated. replaced by getPermanentLinkHelper()

Gets a URL that displays the Details page of the given element.

The context and the datasource name are loaded from the session.

Parameters:
handle - Handle on the element from which you want to display the details.
Returns:
The URL of the element details.

getSelectedElementsInTable

public List getSelectedElementsInTable()
Returns the list of elements currently selected in the current displayed element table (Explore or Query tab).

Returns:
A list of ilog.rules.teamserver.model.IlrElementDetails objects.

getDisplayElements

public List<IlrElementSummary> getDisplayElements()
Gets the currently displayed elements in the table.

Returns:
a list of summaries, instances of IlrElementSummary

getSelectedElement

public IlrElementDetails getSelectedElement()
Gets the element currently selected in the console.

The element will be either the one currently selected in the left pane of the Explore tab or the element currently being viewed or edited. In any case, the returned element is the one that was selected last.


noItemSelectedSingle

public String noItemSelectedSingle()
Error message helper.

Should be returned when an action is triggered but no element was selected.

Returns:
An error message.

getOrCreateAndOpenCurrentPort

public static IlxWPort getOrCreateAndOpenCurrentPort()
Gets or creates the current web component port and opens it if not already done.

Always use this method instead of IlxWPort.getCurrentPort() and IlxWPort.open() when you want to print some web components in a JSP page containing some other tags that already print some components.

The Decision Center JSF components that internally use the web components also call this method. This will ensure that 2 ports are not used twice in the same JSP page, which is not suported by the web component framework.


getPermanentLinkHelper

public IlrPermanentLinkHelper getPermanentLinkHelper()
Gets the permanent link helper for this bean.

The helper will be set up so that when a permalink is generated from it, it will embed in any page of the Decision Center console.

Since:
JRules 6.7
Returns:
A permanent link helper.

getCurrentTreeController

public IlrTreeController getCurrentTreeController()
Returns:
The tree controller for the rule explorer

isProjectModeInit

public boolean isProjectModeInit()

setProjectModeInit

public void setProjectModeInit(boolean init)

isWorkOnProject

public boolean isWorkOnProject()

setWorkOnProjectValue

public void setWorkOnProjectValue(String newValue)

getWorkOnProjectValue

public String getWorkOnProjectValue()

confirmSelection

public String confirmSelection()

saveAsLastBaseline

public void saveAsLastBaseline(IlrBaseline baseline)

isReleaseActive

public boolean isReleaseActive()

isActivityActive

public boolean isActivityActive()

Decision Center API

© Copyright IBM Corp. 1987, 2013