com.ibm.openpages.api.trigger.events

Class CreateResourceEvent

  • Direct Known Subclasses:
    CreateResourceWithRelationsEvent


    public class CreateResourceEvent
    extends AbstractResourceEvent

    Represents the event type for creating a resource object. The resource being created is provided by the AbstractResourceEvent.getResource(). In the POST TriggerPositionType, the object that was created is available. To access the newly created object, use the getCreatedResource() method. This is useful if the event handler requires the Id for the newly created resource.

    For an event handler which handles the CreateResourceEvent, the values of the resource object being saved can be modified directly. A separate call to IResourceService.saveResource() is not required.

    See Also:
    TriggerEventType.CREATE_OBJECT
    • Constructor Detail

      • CreateResourceEvent

        public CreateResourceEvent(TriggerPositionType position,
                                   Context context)
        Default constructor.
        Parameters:
        position - either pre or post
        context - the Context for the API
      • CreateResourceEvent

        public CreateResourceEvent(IResource resource,
                                   TriggerPositionType position,
                                   Context context)
        Constructor with the resource to be created.
        Parameters:
        resource - the folder or GRC object that is the focus of the event
        position - either pre or post
        context - the Context for the API
    • Method Detail

      • getCreatedResource

        public IResource getCreatedResource()
        If available, as in a POST event, Returns the created resource object that was the result of this create event i.e. the resource that was created.
        Returns:
        created resource if available, or null

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.