Subscribe event workflow to repository service

I Subscribe the event StatemanamengEvent.PUBLISH_TEMPLATE to Repository Service for documents with state publish, but need know that event is associated to state Approved/Reject when a document is submit for approval.
help me please.

Hello Alexander ~
I've used StatemanagementEvent.PUBLISH, and I can confirm that it is triggered when a document goes through the entire approval workflow and is completely approved.
I'm not sure what event fires when a document is rejected.  Try checking out <a href="http://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/com/sapportals/wcm/repository/service/statemanagement/IStatemanagementEvent.html">this documentation</a>.  It may point you in the right direction.
Hope this helps a bit.
Cheers,
Fallon

Similar Messages

  • Repository service and the PRE_DELETE Event

    Hello,
    I have implemented a repository service which is reacting on the PRE_DELETE event. I want to develop a recycle bin functionality.
    The problem is that the resource is already deleted when I get the PRE_DELETE event and I can't move or copy the resource any more.
    Is there a possibility to access the resource? Or another event?
    Thanks
    David

    Hi Rui,
    I was thinking about the solution with the new delete command but my problem is to secure  that I have changed the delete command in all necessary layout sets ( Search Result, Favorits, all navigation iViews and so on). And also to secure that I don't have to change system iViews or system layout sets. Tips to secure the changes are really appreciated.
    Has some one experiences with the PRE_DELETE or the DELETE Event?
    Thanks
    David

  • How to develop a Repository Service to trigger a workflow automatically??

    Hi All,
         I have configured a approval workflow on the folder <b>/documents/test</b> in <b>KM Content</b>.
         <b>I want to trigger this workflow automatically whenever a new document is created in this folder.</b>
         How can i do it? Should i create a Repository Service? or is there any other way??
         I can't find a lot of info about creating Repository Service. I have seen other threads in this forum too.
         Can any1 plz help me in this regard?? <b>Any code samples???</b>
         Would appreciate any kind of help. It's kinda urgent.
    Thanks in advance.
    <b>Regards,
    Sai Krishna.</b>

    Hello Praveen,
    thank you for answer and the link to the sap help.
    sorry for my beginner questions, but in sap help in chapter "Setting up the J2EE Engine for Debugging" under number one "Start the Config tool and connect to the J2EE Engine database.".
    Where will I find this config tool?
    Regards,
    Markus

  • Informatica 9.0.1 Repository Service Shutdown Error when Running ETL in DAC

    Hi All,
    When I executed the ETL in DAC client for full data load, I got this error from log "PLP_LoyMemberTierMovementQtrAggr.log".
    "Failed to connect to the repository on Host : hkhgc01dvapp01, Port : 6315. System Error (errno = 111): Connection refused.)"
    Does it relate to the "Minimun Port Number" and "Maximun Port Number", I set both of them to 6315 in the node01's "Advanced Properties".
    Here list the full log:
    INFO : LM_36435 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Starting execution of workflow [PLP_LoyMemberTierMovementQtrAggr] in folder [PLP] last saved by user [Administrator].
    INFO : LM_44206 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Workflow PLP_LoyMemberTierMovementQtrAggr started with run id [481], run instance name [], run type [Concurrent Run Disabled].
    INFO : LM_44195 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Workflow [PLP_LoyMemberTierMovementQtrAggr] service level [SLPriority:5,SLDispatchWaitTime:1800].
    INFO : VAR_27085 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Parameter file [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Temp/PLP_LoyMemberTierMovementQtrAggr_5U627E] is opened for [workflow [PLP_LoyMemberTierMovementQtrAggr]].
    INFO : LM_44253 : (19218|1327462720) Workflow started. Clients will be notified
    INFO : LM_36330 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Start task instance [Start]: Execution started.
    INFO : LM_36318 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Start task instance [Start]: Execution succeeded.
    INFO : LM_36505 : (19218|1327462720) Link [Start --> PLP_LoyMemberTierMovementQtrAggr]: empty expression string, evaluated to TRUE.
    INFO : LM_36388 [Tue Aug 02 17:03:02 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] is waiting to be started.
    INFO : LM_36682 [Tue Aug 02 17:03:02 2011] : (19218|1344248128) Session task instance [PLP_LoyMemberTierMovementQtrAggr]: started a process with pid [19492] on node [node01_hkhgc01dvapp01].
    INFO : LM_36330 [Tue Aug 02 17:03:02 2011] : (19218|1344248128) Session task instance [PLP_LoyMemberTierMovementQtrAggr]: Execution started.
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6793 Fetching initialization properties from the Integration Service. : (Tue Aug 02 17:03:03 2011)]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [DISP_20305 The [Preparer] DTM with process id [19492] is running on node [node01_hkhgc01dvapp01].
    : (Tue Aug 02 17:03:03 2011)]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [PETL_24036 Beginning the prepare phase for the session.]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6721 Started [Connect to Repository].]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6722 Finished [Connect to Repository]. It took [1.89204] seconds.]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6794 Connected to repository [Oracle_BI_DW_Base] in domain [Domain_hkhgc01dvapp01] as user [Administrator] in security domain [Native].]
    INFO : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6721 Started [Fetch Session from Repository].]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_51490] Communication with client application on host [10.32.64.75] and port [6315] has failed because of network errors. [System Error (errno = 11): Resource temporarily unavailable].)]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12014 An error occurred while accessing the repository]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error (Connection to the Repository Service [Oracle_BI_DW_Base] is broken.)]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55101] Connection to the Repository Service [Oracle_BI_DW_Base] is broken.)]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55114] Reconnecting to the Repository Service [Oracle_BI_DW_Base]. The resilience time is 180 seconds.)]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:03:05 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_51147] Failed to connect to the repository on Host : hkhgc01dvapp01, Port : 6315. System Error (errno = 111): Connection refused.)]
    ERROR : LM_36488 [Tue Aug 02 17:04:09 2011] : (19218|1327462720) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:04:09 2011]]
    WARNING : LM_36371 : (19218|1335855424) Workflow [PLP_LoyMemberTierMovementQtrAggr] is aborting.
    ERROR : REP_12400 : (19218|1335855424) Repository Error ([REP_12164] Domain-related error: [[DOM_10164] [DOM_10164] Service [Oracle_BI_DW_Base] is disabled in domain [Domain_hkhgc01dvapp01]. [FAULT_PCSFINTERNALEXCEPTION]].)
    ERROR : REP_12400 : (19218|1335855424) Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : REP_12014 : (19218|1335855424) An error occurred while accessing the repository
    ERROR : REP_12400 : (19218|1335855424) Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : REP_12400 : (19218|1335855424) Repository Error ([REP_55102] Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : LM_36060 : (19218|1335855424) Detected a failure on the repository connection(s).
    ERROR : LM_36028 : (19218|1335855424) Failed to get a repository connection.
    ERROR : LM_36110 : (19218|1335855424) Folder [id = 8] not found.
    ERROR : REP_12400 : (19218|1335855424) Repository Error ([REP_12164] Domain-related error: [[DOM_10164] [DOM_10164] Service [Oracle_BI_DW_Base] is disabled in domain [Domain_hkhgc01dvapp01]. [FAULT_PCSFINTERNALEXCEPTION]].)
    ERROR : REP_12400 : (19218|1335855424) Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : REP_12014 : (19218|1335855424) An error occurred while accessing the repository
    ERROR : REP_12400 : (19218|1335855424) Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : REP_12400 : (19218|1335855424) Repository Error ([REP_55102] Failed to connect to repository service [Oracle_BI_DW_Base].)
    ERROR : LM_36060 : (19218|1335855424) Detected a failure on the repository connection(s).
    ERROR : LM_36028 : (19218|1335855424) Failed to get a repository connection.
    ERROR : LM_36110 : (19218|1335855424) Folder [id = 8] not found.
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55115] Still trying to connect to the Repository Service [Oracle_BI_DW_Base]. The remaining resilience time is 116 seconds.)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:04:15 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_12164] Domain-related error: [[DOM_10051] [DOM_10051] Service [Oracle_BI_DW_Base] is not available in domain [Domain_hkhgc01dvapp01]. [FAULT_PCSFTIMEOUTEXCEPTION]].)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:05:16 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55115] Still trying to connect to the Repository Service [Oracle_BI_DW_Base]. The remaining resilience time is 49 seconds.)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:05:23 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_12164] Domain-related error: [[DOM_10051] [DOM_10051] Service [Oracle_BI_DW_Base] is not available in domain [Domain_hkhgc01dvapp01]. [FAULT_PCSFTIMEOUTEXCEPTION]].)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55112] Unable to connect to the Repository Service [Oracle_BI_DW_Base] since the resilience time is up.)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12014 An error occurred while accessing the repository]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error (Failed to connect to repository service [Oracle_BI_DW_Base].)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [REP_12400 Repository Error ([REP_55102] Failed to connect to repository service [Oracle_BI_DW_Base].)]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [CMN_1761 Timestamp Event: [Tue Aug 02 17:06:06 2011]]
    ERROR : LM_36488 [Tue Aug 02 17:09:24 2011] : (19218|1335855424) Session task instance [PLP_LoyMemberTierMovementQtrAggr] : [TM_6224 Failed to fetch session information from the repository in folder [PLP] for session [PLP_LoyMemberTierMovementQtrAggr.PLP_LoyMemberTierMovementQtrAggr]...Unable to Fetch Mapping associated with the session
    ERROR : LM_44131 : (19218|1335855424) Failed to process the handle prepare done request for task [Session task instance [PLP_LoyMemberTierMovementQtrAggr]] since the task is in a terminating state.
    WARNING : LM_36322 [Tue Aug 02 17:09:34 2011] : (19218|1361033536) Session task instance [PLP_LoyMemberTierMovementQtrAggr]: Execution aborted.
    WARNING : LM_36322 [Tue Aug 02 17:09:35 2011] : (19218|1361033536) Workflow [PLP_LoyMemberTierMovementQtrAggr]: Execution aborted.
    Could any one help, thank you very mcuh!
    Best regards,
    Ryan

    what you are describing does not sound like a mapping issue. It sounds more like a network issue or issue with your client/server services. Did you try to stop/restart all services. First see if you can stop/restart everything (DAC, INFA) re-open a new client connection. Then see if you can open the mapping and validate it. Once this is complete, try to run just the workflow standalone. If that is successful, restart the execution plan. Overall, it sounds like a server or connectivity issue, not a mapping logic issue. if this was helpful, mark the response as correct.

  • FTP-adapter does not register subscribed events

    I have installed an FTP-adapter and configured it to receive messages. I have created an application with the same name and set up a subscription to an event from an generic adapter. I have another db adapter also subscribing to the same event, and this works fine. However the ftp adapter does not receive the subscribed event. I have checked the MESSAGEINFOIDTABLE table, and the subscription between the FTP adapter and the genric adapter is not registered here. I have tried to resintall the adapter several times using different names etc, but it does not seem to register. Anyone had this situation before, or does anoyone have any tips?

    Audun,
    This is very strange. You haven't got 2 environments have you? Developing on one, but looking at another? Sorry for the dumb question, but I've done that before!!
    If you have 1 event, 1 publishing and 2 subscribing, then your count on the MESSAGEINFOIDTABLE table for this event should be 3.
    Have you tried pushing the metadata in iStudio to your FTP Adapter? Or restarting the FTP Adapter?
    You've definately subscribed to the correct Business Object and Event when mapping your message from Common View to Subscribe view?
    Your repository may be all screwed up. This can happen. iStudio doesn't have the best history! When you've reinstalled the adapter again, or re-designed the message again and again, you could have orphaned objects all over the place preventing proper message design taking place.
    As a sanity check, stop all services connecting the repository (iStudio, Adapters, OEM, sqlplus etc.) Save / backing up your current repository using the "oaiexport" script.
    Once you done that, drop the existing repository, and create a new fresh one. (use the "hubschema" -drop, then -create script).
    Just try creating that same single message design again with just one publishing and one subscribing adapter.
    If you still have the same problem, then I think it is one for Oracle Support.
    Good luck,
    Yan

  • Error while creating Informatica Repository Service

    I am installing OBIApps - Have done it previously so I know it is a complex installation.
    This time my server is a Linux RH 64bit... Informatica server installed ok. Using the administrator panel, I am now trying to create the repository service.
    I am getting error: Database driver event…Error occurred loading library [libclntsh.so.10.1: wrong ELF class: ELFCLASS32] Database driver event…Error occurred loading library [libpmora8.so]
    I know the infra structure guys installed Oracle client 32bit... Maybe this is the trouble ?
    I have LD_LIBRARY_PATH blank... if I point the LD_LIBRARY_PATH to the oracle client bin... it seems that informatica startup has trouble since administrator panel doesn´t start. went back to LD_LIBRARY_PATH blank and startup is ok and administrator is ok... but error in creating repository service persists...
    I appreciate any hints.
    Txs.
    Antonio

    Try with by execute relink all libraries:
    $relink all
    or else go with 64bit

  • Getting WCMException while configuring a repository service

    Hi KM Experts,
    I wrote a program to create a repository service, to start the approval process automatically, and select it for the required repository manager. I restarted the servlet engine, but still the status of newly added document is 'In Progress' and when I tried to submit it manually its throwing the following exception -
    Could not execute command 'com.sapportals.wcm.rendering.uicommand.cm.UIStatemanagementCommand'
    Below is the program written by me -
    package com.infy.autoapprove;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.repository.service.AbstractRepositoryService;
    import com.sapportals.wcm.repository.service.IRepositoryServiceFactory;
    import com.sapportals.wcm.repository.service.ServiceNotAvailableException;
    import com.sapportals.wcm.repository.service.statemanagement.IResourceTransition;
    import com.sapportals.wcm.repository.service.statemanagement.IStatemanagementManager;
    import com.sapportals.wcm.repository.service.statemanagement.IStatemanagementResource;
    import com.sapportals.wcm.repository.manager.IResourceEventReceiver;
    import com.sapportals.wcm.repository.manager.IRepositoryManager;
    import com.sapportals.wcm.repository.manager.ResourceEvent;
    import com.sapportals.wcm.util.events.IEvent;
    import com.sapportals.wcm.crt.component.*;
    import com.sapportals.wcm.crt.configuration.*;
    import com.sapportals.wcm.IWcmConst;
    import com.sapportals.wcm.WcmException;
    import java.util.Collection;
    // implements IMyNewRepositoryService interface
      Note: IReconfigurable and IResourceEventReceiver interfaces are optional
    public class AutoApprove extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
      private static final String TYPE = "AutoApprove";
      public AutoApprove() {
        super();
        // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType() {
        return AutoApprove.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
        // implement this method as follows:
        // - Verify configuration data
        // - Get references to other needed (global) services
        // - Check whether other repository services (this service depends on) are also assigned to the repository managers
        // - Usually the service registers itself for certain events at all repository managers
        try  {
        catch (Exception e) {
          throw new StartupException(e.getMessage(), e);
      protected void shutDownImpl() { }
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
        // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try
               mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_CHILD, null));
         catch(WcmException e)
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
        // Implement this method: Usually the service must unregister itself as an event handler.
      public void reconfigure(IConfiguration config) throws ConfigurationException {
        this.stateHandler.preReconfigure();
        // check the new configuration data
        try {
        catch (ConfigurationException ex) {
          this.stateHandler.postReconfigure(ex);
          throw ex;
        this.config = config;
        this.stateHandler.postReconfigure();
      public void received(IEvent event) {
                   IResource resource = (IResource)event.getParameter();
                   try
                      //     get the statemanagement service from the resource
                      String rid = resource.getRID().toString();
                      if(rid.equals("/documents/TestScenario/XML Form Content/"+resource.getName()))
                           IRepositoryServiceFactory factory = ResourceFactory.getInstance().getServiceFactory();
                            IStatemanagementManager statemanagement = (IStatemanagementManager)factory.getRepositoryService(resource, IWcmConst.STATEMANAGEMENT_SERVICE);
                            IStatemanagementResource sResource = statemanagement.getStatemangementResource(resource);
                            IResourceTransition transition = sResource.getTransition("lbl.submit");
                           //  if everything is correct than transition is not null
                           if (transition != null)
                                     transition.execute();
                   }catch(Exception e){
                        e.printStackTrace();
    Kindly help me out as I am not able to figure out the issue.
    Thanks in Advance,
    Saurabh

    Hi Experts,
    Any help on this ?
    Regards,
    Saurabh

  • KM Repository Service for creating a folder structure

    Hi All,
       We have a requirement in KM. Whenever a folder is created inside a folder (say '/documents/testFolder') ... .. a couple of subFolders need to be created inside this new folder.
    For example, if the new folder's name being created is <i>parentFolder1</i> then, the following structure shud be created inside this folder.
    parentFolder1
      |--> subFolder1
                 |--> subFolder11
                 |--> subFolder12
      |--> subFolder2
                 |--> subFolder21
    I tried to implement a KM repository service::
    My Rep Service code::
    package com.test;
    import java.util.Collection;
    import java.util.Iterator;
    import com.sap.tc.logging.Location;
    import com.sapportals.config.fwk.CannotAccessConfigException;
    import com.sapportals.config.fwk.Configuration;
    import com.sapportals.config.fwk.IConfigClientContext;
    import com.sapportals.config.fwk.IConfigManager;
    import com.sapportals.config.fwk.IConfigPlugin;
    import com.sapportals.config.fwk.IMutableConfigurable;
    import com.sapportals.config.fwk.InitialConfigException;
    import com.sapportals.portal.security.usermanagement.UserManagementException;
    import com.sapportals.wcm.WcmException;
    import com.sapportals.wcm.crt.component.IReconfigurable;
    import com.sapportals.wcm.crt.component.StartupException;
    import com.sapportals.wcm.crt.configuration.ConfigurationException;
    import com.sapportals.wcm.crt.configuration.IConfiguration;
    import com.sapportals.wcm.repository.AccessDeniedException;
    import com.sapportals.wcm.repository.ICollection;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.NotSupportedException;
    import com.sapportals.wcm.repository.Property;
    import com.sapportals.wcm.repository.ResourceException;
    import com.sapportals.wcm.repository.manager.IRepositoryManager;
    import com.sapportals.wcm.repository.manager.IResourceEvent;
    import com.sapportals.wcm.repository.manager.IResourceEventReceiver;
    import com.sapportals.wcm.repository.manager.ResourceEvent;
    import com.sapportals.wcm.repository.service.AbstractRepositoryService;
    import com.sapportals.wcm.repository.service.ServiceNotAvailableException;
    import com.sapportals.wcm.util.config.ConfigCrutch;
    import com.sapportals.wcm.util.events.IEvent;
    // implements IMyNewRepositoryService interface
      Note: IReconfigurable and IResourceEventReceiver interfaces are optional
    public class MytestRepositoryService extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
      private static final String TYPE = "com.test.MytestRepositoryService";
      private Collection repositoryManagers;
      private static final Location log = Location.getLocation(MytestRepositoryService.class);
      //variables
           private static final String PLUGIN_FOLDERCREATION_SERVICE = "/cm/repository_services";
           private static final String CONFIGCLASS_FOLDERCREATION_SERVICE = "com.test.MytestRepositoryService";
           private static final String readPlugins[] = { PLUGIN_FOLDERCREATION_SERVICE };
    public static final String PROP_MYFOLDER = "myFolder";
      public MytestRepositoryService() {
        super();
        // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType() {
        return MytestRepositoryService.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
        // implement this method as follows:
        // - Verify configuration data
        // - Get references to other needed (global) services
        // - Check whether other repository services (this service depends on) are also assigned to the repository managers
        // - Usually the service registers itself for certain events at all repository managers
        try  {
        catch (Exception e) {
          throw new StartupException(e.getMessage(), e);
         this.repositoryManagers = repositoryManagers;
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext()){
           try {
              addRepositoryAssignment((IRepositoryManager) it.next());
           } catch (ServiceNotAvailableException e) {
              e.printStackTrace();
      protected void shutDownImpl() {
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext()){
           try {
              removeRepositoryAssignment((IRepositoryManager) it.next());
           } catch (WcmException e) {
              e.printStackTrace();
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
        // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try {
    //       mgr.getEventBroker().register(this, ResourceEvent.ALL_TEMPLATE);
           mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_COLLECTION, null));
         } catch (WcmException e) {
           e.printStackTrace();
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
        // Implement this method: Usually the service must unregister itself as an event handler.
    //     mgr.getEventBroker().unregister(this, ResourceEvent.ALL_TEMPLATE);
         mgr.getEventBroker().unregister(this, new ResourceEvent(ResourceEvent.CREATE_COLLECTION, null));
      public void reconfigure(IConfiguration config) throws ConfigurationException {
        this.stateHandler.preReconfigure();
        // check the new configuration data
        try {
        catch (ConfigurationException ex) {
          this.stateHandler.postReconfigure(ex);
          throw ex;
        this.config = config;
        this.stateHandler.postReconfigure();
      public void received(IEvent event) {
         IResourceEvent myEvent = (IResourceEvent) event;
         IResource resource = (IResource) myEvent.getParameter();
         String repositoryPath = "";
         String parentPath = "";
                //get the configuration...
                try {
                       IConfigClientContext context = IConfigClientContext.createContext(ConfigCrutch.getConfigServiceUser());
                     IConfigManager cfg = Configuration.getInstance().getConfigManager(context);
                     IConfigPlugin configPlugin = cfg.getConfigPlugin(PLUGIN_FOLDERCREATION_SERVICE);
                     if (configPlugin != null) {
                          IMutableConfigurable[] configurables = configPlugin.getConfigurables(CONFIGCLASS_FOLDERCREATION_SERVICE, false);
                          for (int i = 0; i < configurables.length; i++) {
                               IMutableConfigurable configurable = configurables<i>;
                               if (configurable.getConfigClass().getName().equals(CONFIGCLASS_FOLDERCREATION_SERVICE)) {
                                    // now get the attribute value...
                                    repositoryPath = configurable.getPropertyValue(PROP_MYFOLDER);  //// "documents/parentFolder1"
              } catch (InitialConfigException e2) {
                   e2.printStackTrace();
              } catch (CannotAccessConfigException e2) {
                   e2.printStackTrace();
              } catch (UserManagementException e2) {
                   e2.printStackTrace();
              try {
                   parentPath = resource.getParentCollection().getRID().toString();
              } catch (AccessDeniedException e1) {
                   e1.printStackTrace();
              } catch (ResourceException e1) {
                   e1.printStackTrace();
              if(repositoryPath.equals(parentPath))
                   //write my code here
                   if (resource != null && (resource.isCollection()) )
                        ICollection parentFolder = (ICollection) resource;
                        try {
                             <b>parentFolder.createCollection("subFolder1",null);</b>
                        } catch (NotSupportedException e) {
                             e.printStackTrace();
                        } catch (AccessDeniedException e) {
                             e.printStackTrace();
                        } catch (ResourceException e) {
                             e.printStackTrace();
    <b>...MytestRepositoryService.co.xml:</b>
    - <Configurable configclass="com.test.MytestRepositoryService">
      <property name="name" value="com.test.MytestRepositoryService" />
      <property name="active" value="true" />
    <i>  <property name="myFolder" value="/documents/parentFolder1" /></i>
      <property name="description" />
      </Configurable>
    <b>...MytestRepositoryService.cc.xml:</b>
    - <ConfigClass name="com.test.MytestRepositoryService" extends="RepositoryService">
      <attribute name="class" type="class" constant="com.test.MytestRepositoryService" />
      </ConfigClass>
    Have i done it right?? Where am i going wrong??? Plz advice.
    I need to 'myFolder' as a configurable property in KM's <i>Content Management --> Repository Services</i> section.
    Thanks!
    Regards,
    SK.

    Hi,
    I haven't check your code but you know that you can archive the same without writing a portal componente by using the template feature. It is a simple customizing. See http://help.sap.com/saphelp_nw70/helpdata/en/55/83bd402b8d8031e10000000a1550b0/frameset.htm
    Best Regards
    Frank

  • Hot to retrieve an authenticated user for JCA in a repository service?

    Hi,
    I implemented a repository service wich calls an ABAP Functionmodule via JCA and RFC. This connection has to be build up with the current logged in user.
    But how can I get an authenticated ep6-user in the repository service received-event? Or is it possible to do this with an ep5-user?
    I don't want to use username/password.
    String sapsystem = "R3SYSTEM";
    IConnectorGatewayService cgService = (IConnectorGatewayService)PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
    ConnectionProperties connProps = new ConnectionProperties(locale, (IPrincipal)user);
    IConnection connection = cgService.getConnection(sapsystem, connProps);
    In the last line I got the error message:
    com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: Nested Exception. Failed to get connection. Please contact your admin.
    Any ideas?
    Thanks.

    Peter, the autheticated user is available from the portal request object. Get that one in your application and read from the UME all the properties you wanna get and build your web service call with it. It looks for me straight forward, what exactly is your problem?
    cheers

  • How to get Resource Name in the Repository Service when Publish evt trigger

    Hi ,
    I have created a repository service in which I have registered the
    StatemanagementEvent.PUBLISH
    My requirement is I need to know which resource rather resource name triggered this event.
    This is the code which
    public class ApprovProcs extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver
      private static final String TYPE = "ApprovProcs";
      private Collection repositoryManagers;
      public ApprovProcs()
        super();
        // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType()
        return ApprovProcs.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException
        // implement this method as follows:
        // - Verify configuration data
        // - Get references to other needed (global) services
        // - Check whether other repository services (this service depends on) are also assigned to the repository managers
        // - Usually the service registers itself for certain events at all repository managers
                 this.repositoryManagers = repositoryManagers;
              Iterator it = repositoryManagers.iterator();
              while (it.hasNext())
                   try
                        addRepositoryAssignment( (IRepositoryManager) it.next());
                   catch (ServiceNotAvailableException e)
                        e.printStackTrace();
      protected void shutDownImpl()
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext())
              try
                   removeRepositoryAssignment( (IRepositoryManager) it.next());
              catch (WcmException e)
                   e.printStackTrace();
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException
        // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try
              // capture all the respurce which are published
              mgr.getEventBroker().register( this, new StatemanagementEvent( StatemanagementEvent.PUBLISH, null ));
         catch(WcmException e)
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException
        // Implement this method: Usually the service must unregister itself as an event handler.
         //mgr.getEventBroker().unregister(this, new ResourceEvent(ResourceEvent.CREATE_COLLECTION, null));
         mgr.getEventBroker().unregister( this, new StatemanagementEvent( StatemanagementEvent.PUBLISH, null  ));
      public void reconfigure(IConfiguration config) throws ConfigurationException
        this.stateHandler.preReconfigure();
        // check the new configuration data
        try {
        catch (ConfigurationException ex) {
          this.stateHandler.postReconfigure(ex);
          throw ex;
        this.config = config;
        this.stateHandler.postReconfigure();
      public void received(IEvent event)
         System.err.println( "----rid --42354543--- " );
           IResource rsrPublished  = (IResource)event.getParameter();
           if( rsrPublished != null )
              System.err.println( "----rid --42354543--- rsrPublished.getDescription() --- " + rsrPublished.getDescription() );
           else
              System.err.println( "Resource Does not exist -----" ) ;
    In the log file I am getting Null Pointer Exception
    Can any one please help me in this as where I am going wrong
    thanks
    pk

    Hi Romano & Detlev ,
    Thanks for the reply .
    This is what I was looking
    Detlev:
    About the NPE ... in the above code I am not getting that.
    Thats my mistake
    Earlier I tried with
    IResource rsrPublished  = (IResource)event.getParameter();
    String rid = rsrPublished.getRID().toString();
    In the second line of code I was getting the NPE
    after that I used to if condition to debug it
    Sorry for the confusion...
    One more thing
    which is the event triggered for approval or how to capture the Approval Event when a content is approved by the Approver
    thanks
    pk

  • Repository Service not working

    Hi all,
    I have designed a very simple repository service based on the several code samples here on the forums. Here is the received(IEvent) method i implemented:
    public void received(IEvent event) {
           IResourceEvent resEvent = (IResourceEvent) event;
         IResource resource = resEvent.getResource();
         try {
           resource.rename("my_resource_" + resource.getName());
         } catch (Exception e) {
             e.printStackTrace();           
    When i deploy this PAR file, the service appears on the Repository Services part of the config iView. Then i created a new Repository Manager pointing to /room_extensions/cm_stores/questions/workspaces, which is the directory where this Service must act, and associated my Service with it. Even after restarting, the creation of documents on this folder does not trigger the Rep Service!!! Do you know what am i getting wrong?
    Thanks in advance!
    Thiago

    Hi Thiago,
    Even I am facing a similar issue.Can you please let me know how did you resolve this.
    I had one more doubt,
    I have written a service for a CM repository manager , where the files are managed by the file system.
    My query is -
    If I create a new file directly in the file system (not through KM), will the repository service be triggered.
    I hope it does. Please let me know.
    Regards,
    Vivek

  • Repository Service for Auto Submit for Approval

    Hi all,
    Can anyone help me with the creation of a Repository Service to auto 'submit for approval' any document created.
    My main problem is in two methods:
    1) removeRepositoryAssignment(IRepositoryManager mgr)
      In some samples, I saw always this code line:
      mgr.getEventBroker().unregister(this, ResourceEvent.CREATE_CHILD);
      But in my project the unregister method doesn't have that parameters
    2) received(IEvent event)
      I need some help to know what code should I put
    The remaining steps, I think I can handle by myself.
    Many Thanks,
    Luis

    Hi,
    1) make sure you use com.sapportals.wcm.repository.manager.IRepositoryManager, use the JAR (bc.rf.framework_api.jar from the \usr\sap\XXX\JCXX\j2ee\cluster\serverX\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.netweaver.bc.rf\lib folder) from the portal you are willing to develop to make sure you have the actual libraries.
    2) in this method you have to catch the events that creates the resource (ResourceEvent.CREATE_CHILD) - later you will see, that you have to handle also the CHANGE events and so on. When you have the event, get the resource - for CREATE_CHILD it is
    event.getResource()
    Now you can handle the submit for approval by yourself.
    Romano

  • Using the ITimebasedPublishEvent.EVENT_TYPE_STOP for a repository service

    Hi Expert,
    corresponding the the thread "https://forums.sdn.sap.com/thread.jspa?threadID=789842&tstart=0" I want to implement a repository service, which started when the validto date in the lifetime properiy is exceeded.
    For this case I inserted in the method "received" an If-Clausel which should catch this event, like this:
    public void received(IEvent event) {
         IResourceEvent myEvent = (IResourceEvent) event;
         IResource res = myEvent.getResource();
         if (event.getType() == ITimebasedPublishEvent.EVENT_TYPE_STOP ) {
    Do I have to change something in the "addRepositoryAssignment" and/or "removeRepositoryAssignment"? Or in general?
    Thanks in Advanced!
    Best regards and a nice WE!
    Markus

    Hi Praveen,
    you are right. I found an event "EVENT_TYPE_STOP_TEMPLATE" in the "TimebasedPublishEvent" class, which solve my syntax error.
    Now, I have the problem that the service is never running. From the coding perspective it looks right now ok for me.
    Do you have to make same changes in the settings samewhere?
    Any ideas?
    Best regards,
    Markus
    My Coding for the repository service looks like this right now:
    public class DeleteFile extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
      private static final String TYPE = "ACC_DeleteFile";
      private Collection repositoryManagers;
      public DeleteFile() {
         super();
         // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType() {
         return DeleteFile.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
         // implement this method as follows:
         // - Verify configuration data
         // - Get references to other needed (global) services
         // - Check whether other repository services (this service depends on) are also assigned to the repository managers
         // - Usually the service registers itself for certain events at all repository managers
         this.repositoryManagers = repositoryManagers;
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext()) {
              try {
                   addRepositoryAssignment((IRepositoryManager) it.next());
              } catch (ServiceNotAvailableException e) {
                   throw new StartupException(e.getMessage(), e);
      protected void shutDownImpl() {
         Iterator it = repositoryManagers.iterator();
           while (it.hasNext()) {
                try {
                     removeRepositoryAssignment((IRepositoryManager) it.next());
                } catch (WcmException e) {
                     e.printStackTrace();
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
         // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try {
              mgr.getEventBroker().register( this, TimebasedPublishEvent.EVENT_TYPE_STOP_TEMPLATE);
         } catch (Exception e) {
              e.printStackTrace();
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
         // Implement this method: Usually the service must unregister itself as an event handler.
         mgr.getEventBroker().unregister( this, TimebasedPublishEvent.EVENT_TYPE_STOP_TEMPLATE);
      public void reconfigure(IConfiguration config) throws ConfigurationException {
         this.stateHandler.preReconfigure();
         // check the new configuration data
         try {
         catch (ConfigurationException ex) {
           this.stateHandler.postReconfigure(ex);
           throw ex;
         this.config = config;
         this.stateHandler.postReconfigure();
      public void received(IEvent event) {
         com.sapportals.portal.prt.logger.ILogger logger = com.sapportals.portal.prt.runtime.PortalRuntime.getLogger();
         logger.severe(TYPE, "Start ACCDeleteFile");
         IResourceEvent myEvent = (IResourceEvent) event;
         IResource res = myEvent.getResource();
         if (event.getType() == ITimebasedPublishEvent.EVENT_TYPE_STOP ) {
              try {                    
                   IRepositoryServiceFactory repServiceFactory = ResourceFactory.getInstance().getServiceFactory();
                   IRepositoryService repositoryService =      repServiceFactory.getRepositoryService( res, IWcmConst.TIMEBASED_PUBLISH_SERVICE);
                   ITimebasedPublishServiceManager tpbService = (ITimebasedPublishServiceManager) repositoryService;
                   Date actualDate = new Date();
                   Date validTo = new Date();
                   validTo = tpbService.readInvalidDate(res);
                   if(actualDate.getTime() < validTo.getTime()){
                        res.delete();               
              } catch (Exception e) {
                   e.printStackTrace();
         logger.severe(TYPE, "End ACCDeleteFile");

  • Repository Filter or Repository Service?

    When I upload a file, how am I able to "force" a filename.
    If someone sends a file "myfile.txt", i want that the filename be "Date_report.txt" . Date is a new Property metadata that i defined and that is inserted in the upload screen.
    To do this, i need to implement a repository service or a repository filter - in this case a property filter. I'm making confusion.
    Other question: How do I remove a repository filter or repository service uploaded by me?

    Hi André,
    need to implement a repository service or a repository
    filter - in this case a property filter. I'm making
    confusion
    A Repository Service. A RepService react on events thrown within the repositories life, such as file creation (in your case) etc.  And that's what you want if you really want to change the file's name on upload.
    On the other hand, the standard upload command offers an input field for the name which would become useless now. So in this combination maybe you also should alter the standard implementation to make the field hidden. Be aware of this being a modification of the standard (you can deploy it under your own namespace, but this command's implementation changes regulary...)
    How do I remove a repository filter
    or repository service uploaded by me?
    The concrete filter / service you can just remove via the KM config. The config class definition you can remove if you're deploying your par with an empty (but existing!) configArchive.
    Hope it helps
    Detlev

  • Consuming a web service within a repository service

    Is it possible to consume a web service within a custom KM repository service ? If so, please provide an overview of how I might accomplish this within the NWDS.
    Thanks!

    Hi David,
    Two answers:
    (a) Yes, of course this is possible, there is no technical restriction. For your convenience, you can create a portal service from a WSDL file, see https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.util.developmenttools/docs/newportalservicefromwsdl.html for details (not really up to date, but in case of questions, also check http://help.sap.com/saphelp_nw04/helpdata/en/df/a08340d990ce62e10000000a155106/frameset.htm and around). This way, you can access the portal service as a proxy to the webservice and have the WS-implementation seperated.
    (b) Consider performance impacts!!! Depending on the event you are listening to, this can very easily lead to serious problems. At least, consider caching possibilities...
    Hope it helps
    Detlev

Maybe you are looking for

  • External Send Email's Title Cover displaying wrongly via SAPMV60S

    HI all, I have created 3 deliveries. To create billings, i ran SAPMV60S (Maintain Billing Due List)... After it has created the 3 Billing in the background... I found my send external email output type's email title cover is displaying duplicates of

  • Creating graphics that will reveal a background image underneath?

    I have a background image in my DW doc and I'm creating an interface in FW and some of the images I want to display as semi-transparent so the background shows through. I select the image, select transparency and lower it, save as a png32, though whe

  • How to extract word coordinates from PDF using vc++6.0

    In sdk,i just know how to get coordinate from pdf using javascript,and it will be completed use vb.but i dont know how to get the coordinate througt vc++6.0.anyone can help me? thank you advance!

  • Tri-band Nokia needed

    OK, I have what (I hope) is an easy question I need to uograde my phone to a Tri-band model. BUT I don't want to have to buy a new car kit as well, so.... Is there a Nokia Tri-band phone that will fit the same car kit as for a 3310 phone??? I'm suspe

  • Hand mouse icon in Table Controle

    Hi Guys, Is it possible to change the mouse icon into a hand in a table controle when it pass over a field? This field must call other transaction filling the Parameter ID with your content. Att.