Determining the approval state of a document?

Hi All
I have writen a piece of code which moves a document from one folder to another which works ok, however I want to add in another step which will check to see if the document has been approved before it trys to move it?
Any ideas?
Current code:
public void received(IEvent event)  {
     IResource resource = (IResource)event.getParameter();
     IResource sourceResource = resource;
     RID destinationRid = null;
     try {
          destinationRid = RID.getRID("/arco_news/LiveNews/" + resource.getName());
     } catch (ResourceException e1) {
               ICopyParameter cp = new CopyParameter();
               cp.setIgnorePropertyFailures(true);
               cp.setOverwrite(true);
     if (sourceResource != null && destinationRid != null){
        try {
          sourceResource.move(destinationRid,cp);
     } catch (NotSupportedException e) {
     } catch (AccessDeniedException e) {
     } catch (ResourceException e) {
Thanks for your help in advance!

Hi Phil,
> Can I use the default the NWDK default?
I beg your pardon - what? "the default the NWDK default"?!?! I absolutely don't know what you have in mind...
> com.sapportals.wcm.repository.service.statemanagement
> however it did not like it
Of course you have to point the build path to the corresponding JAR and additionally add a corresponding SharingReference.
To comfortably search for the JAR, use ClassLocator (search on SDN for "ClassLocator" for further hints).
Hope it helps
Detlev

Similar Messages

  • How to automate the approval procees of a document in UWL?

    Hi All,
    I am using the action Inbox connector to publish a document in KM after after approval.
    My requirement is that the doc shud be approved automatically  if the manager doesn't approves in a particular timespan.
    The action handler for the approve action in UWL xml is com.sap.km.approve.
    Please guide me how to achieve this.
    Regards,
    Sumit

    Hi Sumit,
    In order to publish a document you could try something like this:
    IResource resource = ....;
    IStatemanagementManager service = (IStatemanagementManager)ResourceFactory.getInstance().getServiceFactory().getRepositoryService(resource, "StatemanagementRepositoryService");
    IStatemanagementResource smResource = service.getStatemangementResource(resource);
    IResourceTransition resourceTransition = smResource.getTransition("lbl.skip.tobereleased");
    boolean success = resourceTransition.execute();
    Now this will only work if the user in the ResouceContext is an owner of the resource and if the resource is in "To be released" status.
    For a better understanding of the process decompile km.appl.repository.service.statemanagement_core.jar and study the code.
    Best regards,
    Avishai Zamir

  • A better way to determine the current state of the FLVPlayback component?

    Below is the AS3 code I have used to display images (MCs) over an instance of the FLVPlayback component.  These images (one for loading, one for the title) are to appear – or disappear – according to the current state of the FLVPlayback component. 
    It “works,” but when testing, I have noticed that it can be rather finicky.  The most common issue that arises is that many times the loadPoster movieclip will still be visible even though the video has entered the playing state.
    Also, I wanted a title placeholder image to appear whenever the user stops the video or if the video completes.  However, I had to add the conditional statement to the “stoppedStateEntered” case to make everything appear when expected.  When the video is first viewed (and has completed buffering), it seems that the FLVPlayback component enters the stopped state before entering the playing state.  Thus, the titlePoster would flash on the screen right before it and the loadPoster “should” disappear when the video begins playing.
    Even in my limited testing, these issues were very easily re-created.  I am definitely looking for a more reliable solution.  Is there a better (or more correct) way to go about all this?  If possible, I would like to stick with the FLVPlayback component, just for the simple fact of not having to code my own.
    Where am I going wrong?
    function updateMoviePoster(event:VideoEvent):void
                    switch (event.type)
                                    case "playingStateEntered":
                                                    loadPoster.visible = false;
                                                    titlePoster.visible = false;
                                    break;
                                    case "stoppedStateEntered":
                                                    if (loadPoster.visible == false)
                                                                    titlePoster.visible = true;
                                    break;
                                    case "complete":
                                                    titlePoster.visible = true;
                                    break;
    myFLVPlayback.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.STOPPED_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.COMPLETE, updateMoviePoster);

    Any suggestions?  I would truly appreciate the help.

  • Determine the Approval List of a service transaction on Oder Save BADI.

    Hi
    I have to determine the list of approvers r a service transaction, based on parties involved assignment block thus I have to take manager's details from parties involved and then some how put the same manager in the list of approvals assignment block.
    In my code I just read the et_partner  and then build the et_approval table based on the partner function using crm_order_read.
    I have build the input fields, input fields names, the logical key and when I pass my input_fields to my order_maintain but for some reason the record is not created or updated on the UI.
    Regards
    Thato

    pl check allowed object for maintenance w.r.t. transaction type by  FM CRM_ORDER_OBJECT_ASSI_SEL_CB = get the allowed objects of a process type.
    Also, can you please share code what you have written ?

  • How to find the approval status for a document version

    Hi all,
    We have enabled versioning on a folder and the system is maintaining the versions. I need to be able to identify which version in at what status.
    For example, I create a file and it creates a version, I check it in and out several times, I then release/publish the file, and another version is created, I then check it out and in several times and the cycle begins again.
    I then realize that I need to go back to the latest released version but I don't know which one it is nor can I identify it using the 'versions' selection from details. How do I know what the status is of the previous versions?
    I need to be able to identify only those versions, past and present, that were 'approved/released' vs those that were left in progress. How do I find the statuses of the previous versions to correctly identify which version was released.
    KM is maintaining this some how because it knows to show only those items that are released to the standard user and not show them those that are in progress.
    How do I find that same parameter that shows me which older version is release?
    I am looking for something like what is available with the properties selection on the 'versions' screen. I am able to go to any version and look at the properties of that version at the time the version was saved. This is what I need with status. I need to be able to look at any version and know what status was at the time it was saved.
    Any help is appreciated,
    Srini

    Hi
    According to my knowledge,Versioning can only be done on files, not folders.
    To view the version history of a file, as well as save prior revisions to another location to view them do this:
           1.      Using Windows Explorer, locate the file.
           2.      Right-click the file and select Versioning and then select List Version History.
    The resulting dialog displays the version history of this file.
           3.      Select a prior version and click the Save As button to save the version to another location.
    Regards
    Elizabeth

  • How to find the approver from request key

    How to determine the approver from request key.
    If the approver is a group where do i find the correlation.
    I have checked WFTASK and WFTASK HISTORY but unable to correlate. This is with respect to OIM 11G R2
    Many Thanks

    select IDENTIFICATIONKEY, TASKID, TASKGROUPID, TASKNUMBER, OUTCOME, STATE, ASSIGNEDDATE, Assignees, APPROVERS, TASKDEFINITIONNAME, CREATOR, ORIGINALASSIGNEEUSER, SUBSTATE from WFTASK where identificationkey = <request key>

  • Add a field to the last page of a document file only

    Hello,
    I currently have a script which will add signature and text fields to the first page of a document.
    The script is required to specify the "last page" of the document and not the page number, as each file will vary with the number of pages.
    The script is in run in batch processing on multiple files which are not open (usually 50 at a time).
    If anyone can please advise how to modify the script I will be most grateful.
    // Create Date field dynamically for employee signature field
    var f = this.addField("Todaydate", "text", 0,
    [60, 54, 135, 75]);
    f.userName = "Today's Date";
    f.value = "Automatic Update";
    f.readonly = true;
    f.fillColor = color.ltGray;
    // Create signature field dynamically for employee
    var f = this.addField("mySignature", "signature", 0,
    [120, 85, 330, 105]);
    f.setAction("OnFocus", "var f = this.getField('Todaydate'); f.value = util.printd('d/mm/yyyy', new Date());");

    Thank you very much for your help, I really appreciate your quick response.
    The script has been modified as you suggested and the fields are now added to the last page of each document and is working perfectly.
    I have included the modified script as follows for reference:
    // Create Date field dynamically for employee signature field, add fields to the last page of every file
    // Determine the last page of this document
    var page = this.numPages - 1;
    var f = this.addField("Todaydate", "text", page,
    [60, 54, 135, 75]);
    f.userName = "Today's Date";
    f.value = "Automatic Update";
    f.readonly = true;
    f.fillColor = color.ltGray;
    // Create signature field dynamically for employee
    var f = this.addField("mySignature", "signature", page,
    [120, 85, 330, 105]);
    f.setAction("OnFocus", "var f = this.getField('Todaydate'); f.value = util.printd('d/mm/yyyy', new Date());");

  • How Can I Determine the Size of the 'My Documents' Folder for every user on a local machine using VBScript?

    Hello,
    I am at my wits end into this. Either I am doing it the wrong way or it is not possible.
    Let me explain. I need a vb script for the following scenario:
    1. The script is to run on multiple Windows 7 machines (32-Bit & 64-Bit alike).
    2. These are shared workstation i.e. different users login to these machines from time to time.
    3. The objective of this script is to traverse through each User Profile folder and get the size of the 'My Documents' folder within each User Profile folder. This information is to be written to a
    .CSV file located at C:\Temp directory on the machine.
    4. This script would be pushed to all workstations from SCCM. It would be configured to execute with
    System Rights
    I tried the script detailed at:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/31/how-can-i-determine-the-size-of-the-my-documents-folder.aspx 
    Const MY_DOCUMENTS = &H5&
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(MY_DOCUMENTS)
    Set objFolderItem = objFolder.Self
    strPath = objFolderItem.Path
    Set objFolder = objFSO.GetFolder(strPath)
    Wscript.Echo objFolder.Size
    The Wscript.Echo objFolder.Size command in the script at the above mentioned link returned the value as
    '0' (zero) for the current logged on user. Although the actual size was like 30 MB or so.
    I then tried the script at:
    http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_27869829.html
    This script returns the correct value but only for the current logged-on user.
    Const blnShowErrors = False
    ' Set up filesystem object for usage
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")
    ' Display desired folder sizes
    Wscript.Echo "MyDocuments : " & FormatSize(FindFiles(objFSO.GetFolder(objShell.SpecialFolders("MyDocuments"))))
    ' Recursively tally the size of all files under a folder
    ' Protect against folders or files that are not accessible
    Function FindFiles(objFolder)
    On Error Resume Next
    ' List files
    For Each objFile In objFolder.Files
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:01", objFolder.Path
    On Error Resume Next
    FindFiles = FindFiles + objFile.Size
    If Err.Number <> 0 Then ShowError "FindFiles:02", objFile.Path
    Next
    If Err.Number = 0 Then
    ' Recursively drill down into subfolder
    For Each objSubFolder In objFolder.SubFolders
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:04", objFolder.Path
    FindFiles = FindFiles + FindFiles(objSubFolder)
    If Err.Number <> 0 Then ShowError "FindFiles:05", objSubFolder.Path
    Next
    Else
    ShowError "FindFiles:03", objFolder.Path
    End If
    End Function
    ' Function to format a number into typical size scales
    Function FormatSize(iSize)
    aLabel = Array("bytes", "KB", "MB", "GB", "TB")
    For i = 0 to 4
    If iSize > 1024 Then iSize = iSize / 1024 Else Exit For End If
    Next
    FormatSize = Round(iSize, 2) & " " & aLabel(i)
    End Function
    Sub ShowError(strLocation, strMessage)
    If blnShowErrors Then
    WScript.StdErr.WriteLine "==> ERROR at [" & strLocation & "]"
    WScript.StdErr.WriteLine " Number:[" & Err.Number & "], Source:[" & Err.Source & "], Desc:[" & Err.Description & "]"
    WScript.StdErr.WriteLine " " & strMessage
    Err.Clear
    End If
    End Sub
    The only part pending, is to achieve this for the 'My Documents' folder within each User Profile folder.
    Is this possible?
    Please help.

    Here are a bunch of scripts to get folder size under all circumstances.  Take your pick.
    https://gallery.technet.microsoft.com/scriptcenter/site/search?query=get%20folder%20size&f%5B0%5D.Value=get%20folder%20size&f%5B0%5D.Type=SearchText&ac=2
    ¯\_(ツ)_/¯

  • How to determine the page count of the front document (pdf-Preview) with applescript?

    Hello, I'm a beinnger apple scripter, and I have 2 questions. First, im trying to find the code to generate a page count for the front document of preview. I tried something like this:
    choose file with prompt "Count the number of pages in this PDF file:" without invisibles
    do shell script "/usr/bin/mdls -name kMDItemNumberOfPages " & quoted form of POSIX path of result & " | /usr/bin/grep -o '[0-9]\\+$'"
    But I dont want to have to choose a file with the prompt, and Im not sure how to get the path or POSIX path of an open pdf that is the front document in prievew to then use that directory to select the file to run the shell script on. This is one step in a much larger sequence of automator/apple script commands for large print jobs.
    The large scale view is:
    1. seleting a group .musx Finale 2014 files and creating pdfs of all the documents
         -Achieved with Automator stuff: [Get selected finder items] [open finder items with Finale 2014] [run applescript to convert to pdf all the open files] (which I have working but without a proper repeat condition)
    2. sorting those those exports into even/odd groups
    3. making the even pages 2 up with a create booklet plugin
    3. combinging even/odd group pdfs in their respective folders
    4. sending the 2 up evens to 1 printer, and the singes to another printer.
    but at this stage in the code/automator this is what i'll need to be doing:
    1. Several pdf documents will be open and I need to determine the page count of the front document.
    2. With that result I need to determine if the pagecount is even or odd.
    3. If its even, I need to save as pdf in a file folder /desktop/PDF Export/Doubles
         - if its odd, I need to save as pdf pages from 1 to (pageCount -1) to /desktop/PDF Export/Doubles, and pages (pageCount) to (pageCount) to desktop/PDF Export/Singles. (example: A 5 page pdf will send pages 1-4 to folder "Doubles", and pages from 5 to 5 to Singles, A 1 page pdf will only send a copy to the folder "Singles." A 2 page pdf will send both pages to "doubles"
    4. once the even/odd pages have had pdfs made in the either or both of the folders, Im going to close the document and repeat for all other open pdfs.
    Which also brings me to my 2nd repeat condition question: how can I repeat (print, save as pdf, close) commands for open files and end the script once all files are closed? This can help me both at this stage, as well the coding stage before in creating the pdfs from open Finale/sibelius .sib/.musx files
    would it be something like this?:
    If front document exists
    try
    tell application "preview"
    <bla bla>
    end try
    end tell
    At stage 1 of the large scale i've gotten the files to export pdfs and close multiple files, but if i say "repeat 4 times" and i have 3 files it can do those commands but it gets stuck trying to repeat the code one more time. I need the repeat amount x to be the # of items in selection from the the original finder window.
    Thanks for the help!

    The following AppleScript will get the POSIX path and filename of the current PDF file. It will just return the integer value for page count. Note: The path retrieved is the actual path to the PDF file, unless it is on the Desktop. In the latter case, the path will be ~/Library/Containers/com.apple.Preview/Data/Desktop/filename.pdf.
    The script assumes that the following folders exist, otherwise you will need a try block to test for their presence.
    The AppleScript dictionary for Preview does not provide a page dictionary entry, that would make a repeat loop and page range possible for saving individual page ranges.
    set pdfDoubles to POSIX path of ((path to desktop) & "PDF Export" & Doubles)
    set pdfSingles to POSIX path of ((path to desktop) & "PDF Export" & Singles)
    tell application "Preview"
      -- gets quoted POSIX path and filename
              set pdfFile to (get path of front document)
              set pdfName to (get name of front document)
      log pdfName
              set cmdArg to "/usr/bin/mdls -name kMDItemNumberOfPages " & pdfFile ¬
                        & " | egrep -o \"(\\d+)\""
              set pageCnt to do shell script cmdArg
      display dialog pageCnt
              if pageCnt mod 2 is 0 then
      -- even
      -- save pdfName in pdfDoubles
              else
      -- save pdfName in pdfDoubles
      -- save individual pages in pdfSingles
              end if
    end tell

  • The JS statement document.getElementsByName("PME_data_myfield").item(0).outerHTML=""; is not executed in FF, it works on all other browsers

    I am trying to remove an input element from a form with the above statement in a javascript. It works on all other browsers but not on FF. It does not generate an error either. Instead of removing the item it just seems to be ignoring the statement.
    I remove the element with the above statement and then re create a new one with document.createElement. In FF it duplicates the element.

    Firefox only supports innerHTML and not outerHTML, so you need to use other code for Firefox.
    See e.g.:
    * http://snipplr.com/view/5460/outerhtml-in-firefox/
    * http://stackoverflow.com/questions/1700870/how-do-i-do-outerhtml-in-firefox

  • Determining the "type" of a SQL statement

    I'm using the Oracle thin driver with my JDBC program.
    I want to be able to accept a String containing a SQL statement from the user and execute it. If it's a select statement then present the rows returned in a JTable, otherwise retrieve the return value for the command (eg INSERT, DELETE, etc).
    Is there any "readymade" method in JDBC or Oracle driver to determine the type of a SQL statement in this sense. Or do I have to parse it myself? (Imagine having to write code to strip comments out etc!)

    There is no "readymade" method. But an easy way to check will be to check the first 6 charchters of the string.
    You could use
    newString = SQL.substring(0, 5); to obtain the first 6 characters.
    if the characters are "select"
    //do select things
    else
    // do insert/delete whatever things

  • To Activate the Approval Process when document is in update mode

    Dear Expert,
                        I have applied the Approval Process for UDF using the query "Select Distinct 'True' From ORDR T0
    Where IsNull($[ORDR.U_Rebate.number],0)>0 and $[ORDR.DocType]='I' ".
    Now as the field is UDF user is able to modify even after approval procedure.
    Please help me to apply the above query for the  Approval process even when the document is in update mode.
    regards,
    PankajK

    Dear Pankaj,
    Current B1 design only support approval for adding document. Update will not trigger approval.
    You may use SP_TN instead to block user updating it. If you are not familiar with the SP, search the forum first.
    Thanks,
    Gordon

  • Alchemy for xfi - the product state could not be determined (error 6

    as the title states I have xfi platinum & installed alchemy for xfi, tried to start it & I get "the product state could not be determined (error 60)" I click any of the links & it takes me to the buy page for the audigy alchemy. I've tried uninstalling & reinstalling multiple times, also uninstalled & reinstalled my xfi drivers. No change. I can enter anything into the entry field on the activation page & It'll advance me to the next page, then when it goes to connect to creative to register. I get another error. "an error occurred while attempting to connect to the internet. (00000)" I dont have anything blocked regarding this program & have tried with my firewall disabled. Please. Help

    Well I didnt follow the link, but a kind person did download an update for Windows for me, if i can find link i will post it is from USA, took over 2 hours to install/update but appears to fix this problem, i now have all the bits that windows left out back on pc, so there is a solution out there, i know the site it came from there had been 80,000 downloads in over 2 days.

  • Create a one level approval workflow for a document in the document library

    hi,
    Can anyone pls provide me how to create a workflow in  SP 2013.
    I am having  the  scenario
     Document uploaded into the document library. it will  trigger the workflow and it will reach the approver's inbox and if the approver approves the document,  i need to do peform few tasks on the dcoument and document
    library in which it resides.
    So, would like to know whether this is possible without using the new features in SP 2013. like Workflow Manager , etc.
    Heard that,  workflow manager is a new software installable and need to go through separate learning curve.

    but i am having custom columns  which are taxonomy columns, single line of text, choice field, people picker field  etc.
    how can i show these metadat columns in a  approver form using the OOB workflows, does sharepint provides us to  display the  form whcih will be used by the approver and once approved the document will be moved into a  new doc lib 
    and if rejected  it will be deleted  from the  current doc lib.
    also a  email would be sent to requestor who uploads the document.
    I think these customizations were not available in the OOTB workflows.
    pls let me know  any other approaches!
    help is appreciated!

  • Not able to determine the Approvers properly due to data in Approval Master

    Hi All,
    Not able to determine the Approvers properly due to data in Approval master Master table error. This was affected my approval flow. plz help to resolve this.
    Thank you.
    Edited by: ganeshsrm11 on Apr 13, 2010 6:48 AM

    Hi,
    Which table are you talking about? Do you have technical table name? If it is custom table you need to fix your custom program code.
    Regards,
    Masa

Maybe you are looking for

  • Display files/directories of a remote system (RIO) on a host machine (PC)

    Hello, Please assume that we are discussing software built on the standard "Labview FPGA Control on Compact RIO" sample project. The host is a standard PC running LV14 Fall edition, the remote system is an sbRIO-9636 having an SD card and a USB HDD a

  • Songs on my ipod dont show up the way they do in itunes

    there have been a few cds that when I add them to my iTunes library work great, but once I put them on my iPod they dont show up where they're supposed to. For example, I have The Beatles' 1 album and it shows up in iTunes: Artist: The Beatles Album:

  • How to upgrade my Opengl version 1.1 on my Iphone 3gs?

    I want to use 2.0 version because most games require this to run. My OS is 4.3 version.

  • How is PS Linked with MM

    Dear All, Kindly anybody can explain about this scenario. Here the output of the organization is sending man power and material to client to do some work. After completion of work they are raising bill to client. Now in Project System(PS) module they

  • Task bar missing

    A few days ago my Macbook Pro froze while surfing the web, nothing responded so it was necessary to power it off manually, when it came back up i noticed the wifi status, battery meter, time and date and spotlight search on the top right corner have