public interface IGRCObject extends IResource
Represents a GRC Object instance.
GRC Objects contain fields as defined by the type definition for this
instance. The field values can be read or modified through this interface and
then saved. By default all non-computed fields are included when retrieving
or creating a new IGRCObject. Using the
GRCObjectFilter.getFieldFilters() class you can specify to only
include specific fields which reduces overall the size of the object and how
quickly that data can be fetched within the platform.
Example of getting and setting a field on a GRC Object:
// gets the loss event GRC Object
IGRCObject lossEvent = resourceService.getResource(lossId);
// gets the Occurrence Date field,
// knowing this field is of type Date, it is casted from IField to IDateField
IDateField occurenceDate = (IDateField) lossEvent.getField("OPSS-LossEv:Occurrence Date");
// sets the value on the IDateField object
occurenceDate.setValue(new Date());
// alternatively, use ResourceUtil handy methods for setting field value
// without casting
IField recognitionDate = lossEvent.getField("OPSS-LossEv:Recognition Date");
com.ibm.openpages.api.resource.util.ResourceUtil.setFieldValue(recognitionDate, new Date());
// persists all the changes to the GRC Object by saving it
resourceService.saveResource(lossEvent);
GRC Objects are related to other GRC Objects in OpenPages via associations. A
GRC Object can have one or more parents, one or more children and at most one
primary parent association. What associations are allowed for a GRC Object
depends on its type definition which specifies which relationships to other
type definitions are enabled in the OpenPages schema. From the IGRCObject you
can access only the direct parents or children association info which
provides summary info only of the associations. By default no associations
are returned when you get an IGRCObject due to the additional cost of
retrieving associations. If you need to retrieve parents or children you can
specify which to return, or both, in the
GRCObjectFilter.getAssociationFilter()
Example of getting associations from a GRC Object:
GRCObjectFilter filter = new GRCObjectFilter(configurationService.getCurrentReportingPeriod()); filter.getAssociationFilter().setIncludeAssociations(IncludeAssociations.PARENT); // gets the loss event GRC Object with parent associations IGRCObject lossEvent = resourceService.getResource(lossId); // gets the parent associations Listparents = returnObject.getParents();
IResourceService,
ResourceUtil,
GRCObjectFilter| Modifier and Type | Method and Description |
|---|---|
void |
addChildren(java.util.List<Id> children)
Adds children for object creation via
IResourceService.saveResource(IResource). |
void |
addParents(java.util.List<Id> parents)
Adds additional non-primary parents for object creation via
IResourceService.saveResource(IResource). |
java.util.List<Id> |
getActiveWorkflowIds()
Returns a list of ids for the active workflows associated with this
GRC Object.
|
java.util.Map<Id,java.util.List<OpenPagesException>> |
getCalcLogs()
Returns a Map of calculation error results if there is, such as circular calculation.
|
java.util.List<IAssociationNode> |
getChildren()
Returns direct children GRC Object associations defined by the
AssociationFilter supplied to the
IResourceService.getGRCObject(Id, GRCObjectFilter) and
IResourceService.getGRCObject(String, GRCObjectFilter) methods. |
IField |
getField(Id fieldId)
Returns a field based on its field definition Id.
|
IField |
getField(java.lang.String systemName)
Returns a field based on its system name, if it exists.
|
java.util.List<IField> |
getFields()
Returns the list of fields that compose this object.
|
java.util.List<IAssociationNode> |
getParents()
Returns direct parent GRC Object associations defined by the
AssociationFilter supplied to the
IResourceService.getGRCObject(Id, GRCObjectFilter) and
IResourceService.getGRCObject(String, GRCObjectFilter) methods. |
Id |
getPrimaryParent()
Returns the primary parent GRCObject Id.
|
ITypeDefinition |
getType()
Returns the type definition for this object.
|
java.lang.Boolean |
hasCalcInQueue()
Returns whether the resource has stale field value(s) and it is updated by the asynchronous calculations.
|
java.lang.Boolean |
hasCalcLogs()
Returns whether the resource has any calculation errors on fields as well as GRC objects.
|
boolean |
isCheckedOut()
Returns the checkout state of this object.
|
boolean |
isLocked()
Returns the lock state of this object.
|
void |
setPrimaryParent(Id grcObjectId)
Sets the primary parent.
|
void |
setPrimaryParent(IGRCObject grcObject)
Set the primary parent.
|
getCreationDate, getCreator, getDescription, getId, getLastModifiedBy, getModifiedDate, getName, getParentFolder, getPath, isFolder, setDescription, setName, setParentFolderId getPrimaryParent()
void setPrimaryParent(IGRCObject grcObject)
grcObject - the primary parentvoid setPrimaryParent(Id grcObjectId)
grcObjectId - the primary parent GRCObject IdITypeDefinition getType()
IField getField(java.lang.String systemName)
systemName - the system name of the field to retrieveIField getField(Id fieldId)
fieldId - the field Id to retrievejava.util.List<IField> getFields()
java.util.List<IAssociationNode> getParents()
IResourceService.getGRCObject(Id, GRCObjectFilter) and
IResourceService.getGRCObject(String, GRCObjectFilter) methods. Default
behavior of the filter is to return none.void addParents(java.util.List<Id> parents)
IResourceService.saveResource(IResource).
So far this is not supported for updating object via IResourceService.saveResource(IResource).parents - java.util.List<IAssociationNode> getChildren()
IResourceService.getGRCObject(Id, GRCObjectFilter) and
IResourceService.getGRCObject(String, GRCObjectFilter) methods.
Default behavior of the filter is to return none.void addChildren(java.util.List<Id> children)
IResourceService.saveResource(IResource).
So far this is not supported for updating object via IResourceService.saveResource(IResource).parents - java.util.List<Id> getActiveWorkflowIds()
boolean isCheckedOut()
boolean isLocked()
java.lang.Boolean hasCalcInQueue()
GRCObjectFilter.getIncludeCalcStatus() value true.java.lang.Boolean hasCalcLogs()
GRCObjectFilter.getIncludeCalcStatus() value true.java.util.Map<Id,java.util.List<OpenPagesException>> getCalcLogs()
IField.getCalcLogs() for the field calculation errors.
It is only available when the GRC Object is fetched with GRCObjectFilter.getIncludeCalcStatus() value true.ITBRuleService, and value is the list of the errors.
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2021. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.