Idoc scripting in workflow tokens

Greetings,
A question for developers: up to what extent of Idoc Script calls can be made inside Workflow tokens? Only the function wfAddUser or other Idoc Script functions as well?
I'm trying to develop a dynamic workflow component that involves reading possible user, alias or ad-hoc metadata values from a database table using a custom Idoc Script function, into a token. So basicly, something like this:
<$wfAddUser(customIdocScriptFunctionToFetchUsers(dDocType),"user")$>
Is anything like this possible at all? Tests done so far result in the content item entering and exiting the workflow automatically due to probably being unable to load the users, the strange thing is that no erros are being output, not even in the content server output with "workflow" or "idocscript" sections being traced...
The point of this mechanism is to avoid having to create large ammounts of (hidden) metadata to serve as support to store users/alias to be loaded into workflow steps as tokens. Feel free to suggest any other alternatives tho :p
Thanks in advance,
- Tiago Vidigal

Hey Tiago,
Typically you try to limit your token script to just wfAddUser. It is possible to use basically any idoc script in a token but any failure at all will result in the behavior you are seeing with the item skipping straight through the step.
Using your current design here is what I would do:
-In the entry script for that step make your call via the custom script function
-Store the result of the lookup into a workflow variable: <$wfSet("usersForStep", getCustomUsers(dDocType))$>
-do your wfAddUser in the token: <$wfAddUser(wfGet("usersForStep"), "user")$>
-Sidenote: You can add multiple users at once in one wfAddUser call if you pass a comma delimited string of the usernames
Reason this works: the Entry script is always evaluated before a token when entering a step, meaning you can put any complex logic there where it is easier to debug and keep your token code clean.
Hope that helps,
Andy Weaver - Senior Software Consultant
Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw >
Edited by: Andy Weaver on May 18, 2009 10:55 AM
(Fixed one of my code snippets)

Similar Messages

  • Implement Oracle UCM 11.11.5 Workflow (idoc scripting)

    Hi guys,
    We are using Oracle UCM 11.1.1.5.
    We have a 3 stages workflow. The stages are called as "Preparation", "Verification" and "Approval". We use Aliases. Users can be a members of many Aliases. But our requirement is a same user can't approve two subsequent steps. Lets say a user is member of all aliases. Hence he will be able to approve all stages of the workflow. But our requirement is the document who prepared should not be allowed to approve it in the verification stage. The system should throw a warning message. in the same way the person who approves in the verification stage should not be allowed to approve it in the "Approval" stage. Can we use idoc scripting to do that? Please give some idea and sample scripts to do this.
    The question we have are how we can identify the previous stage approver and how we can display warning message on the screen when a same approver trying to approve again in the subsequent stages?
    Thanks in advance
    With Regards
    Jacob
    Edited by: user8778076 on Aug 29, 2011 8:39 AM
    Edited by: user8778076 on Aug 29, 2011 9:04 AM

    Hello VJ,
    Please see details on using Rapid Clone -
    FAQ: Cloning Oracle Applications Release 11i [Doc ID:216664.1]
    Cloning Oracle Applications Release 11i with Rapid Clone [ID 230672.1]
    Regards,
    Debbie

  • Calling GET_WORKFLOW_INFO_BYNAME service from idoc script

    Hi, i need to call service GET_WORKFLOW_INFO_BYNAME in custom idoc script on documents to determine if the document is in workflow. If it is there is no problem. But if it is not, calling if GET_WORKFLOW_INFO_BYNAME cause exception which is writen to server log.
    I don't want to write this exception to log because of log size.
    Is there any way how to suppress the exception or other method to find if the document is in workflow?
    Best regards

    Hi
    I guess you can check the status of the content to verify if a content is any WF or not . If the status is Review / Edit etc then it indicates the content to be part of a WF .
    Hope this helps .
    Thanks
    Srinath

  • IDOC script to get list of users in alias

    Hi ,
    In Workflow script, I want to check if dDocAuthor exists in some alias. IF exists then do some processing.
    I am not able to compare dDocAuthor with users in alias. Infact I could not find any IDOC script function that returns users in alias.
    Please help.
    thanks

    Check out my blog post on how to bypass workflow via idoc if the author is part of a specific alias (:

  • Inbound idoc processing by workflow

    Hello,
    How can I find if an inbound IDoc has been processed via workflow ?
    following are details -
    1)status records 50 and 64 for the idoc show RFC user ID whereas 62 and 53 show WORKFLOW_020 user ID.
    2)manual re process in test system using WE19 has all four status records by login user ID.
    3)BD67 values for this process code was checked for the start events.
    4)I checked standard task 30200090 following oss note 325361
    5)The invoice document posted via this idoc has created by user ID as WORKFLOW_020 
    I do not have full knowledge of inbound idoc processing via workflow and I am in the process of learning the same. Kindly help.
    thank you very much in advance,
    Bhakti

    Hello,
    How can I find if an inbound IDoc has been processed via workflow ?
    following are details -
    1)status records 50 and 64 for the idoc show RFC user ID whereas 62 and 53 show WORKFLOW_020 user ID.
    2)manual re process in test system using WE19 has all four status records by login user ID.
    3)BD67 values for this process code was checked for the start events.
    4)I checked standard task 30200090 following oss note 325361
    5)The invoice document posted via this idoc has created by user ID as WORKFLOW_020 
    I do not have full knowledge of inbound idoc processing via workflow and I am in the process of learning the same. Kindly help.
    thank you very much in advance,
    Bhakti

  • IDOC script in custom element forms

    Hi,
    I am using Site Studio 10gr4.
    I was wondering if its possible to use IDOC script inside custom element forms. What I want to acheive is to display a combox box inside a custom element in a static list. The values inside the combobox are retreived from one of the views (created inside Configuration Manager in the content server).
    Your help will be appreciated.
    Many Thanks

    OK, I found the answer :).
    I checked in the custom element element form as an HTM. Chaning it to HCSP fixed the issue :).

  • How to manipulate the date in idoc scripting?

    how can we manipulate date in idoc scripting? How to retrieve the year, month, date from the date? How can we update the year of the particular date in idoc scripting.

    There are a bunch of date / time functions that you can find in chapter 5 of the Idoc Script Reference (the bible for this sort of thing)
    For the sort of things you need to do I would recommend you look at formatDateWithPattern()
    for example to retrieve the year of 'now'
    <$year = formatDateWithPattern(dateCurrent(),"yyyy")$>
    month
    <$month = formatDateWithPattern(dateCurrent(),"MMM")$>
    the patterns for the same rules as Java date formats (unsurprisingly)
    If you want to update the year then I think you need to build the date as a string and the use the parseDate or parseDateWithPattern functions to actually create something that Idoc will recognise as a date object.
    Tim

  • Making Custom Idoc Script function

    Hi all,
    I am making a custom Idoc Script function. I have merged the resource
    table into the core IdocScriptExtensions table. But i am not able to call the custom function in SiteStudio. Find below the steps that i have taken
    step1) I have added a resource (Static Table) in my component which merges to "IdocScriptExtensions" fucntion.
    Step2) I have already created the java class.
    Step3) Edited <td>Myname</td><td>Myclass</td><td>MyloadOrder</td> in the resource with corresponding values.
    Step4) From component settings added the custom classes.
    Step5) made a build of the component.
    Step6) Installed the component in my server.
    now when i go to SS Designer and call this function then no response is generated.
    This component will return me a boolean by quering DB. I have number of sysouts and traces but none of them is printed on the console. Can somebody please provide insited into what probably might be amiss here.
    ANY pointers will be hightly appriciated. waiting for a quick response.
    reagrds,
    sapan

    Hi Sapan,
    For the most part your steps look correct. Personally I would probably do the following:
    1. move your component's classes folder back inside the component
    2. register the folder in the component
    3. add the folder to the class path
    4. in the component's hda file, check to make sure there the merge rule is set for your IdocScriptExtensions entry.
    if all of those are correct, occasionally the content server can be tempermental when new classes are added and so I would try disabling the component, restarting, then enabling and restarting.
    If everything is compiled, it has to be either a classpath issue or an issue merging your IdocScriptExtensions table.
    Also, if you go to Administration>Configuration Info, expand enabled components and find yours, it will tell your the classpath registered for your component(though your code is in the content server classes folder).
    Sounds like you are really close though...did you get the debugger working?
    David

  • IDoc, EI and Workflow

    Please give me a brief idea about IDoc, EI and Workflow.
    Where I can find the useful documents?
    Can anyone give me any PPT or documents regarding the same topics?

    HI,
    Check the links below:
    ALE:
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217e1c51ce11d189570000e829fbbd/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
    Please check this online document for ALE and IDoc.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
    Also check this links for additional information.
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    IDOCS
    http://idocs.de/www5/books/IDocBook/IDOCS_CHAP09-11.pdf
    http://idocs.de/cookbooks/idoc/cb12_idoc_20_outbound/idoc_outbound_45_rsnast00/docu.htm
    IDOC / ALE Blogs
    /people/raja.thangamani/blog/2007/07/19/troubleshooting-of-ale-process
    /people/kevin.wilson2/blog/2006/11/13/ale-scenario-development-guide
    EDI:
    Advanced guide to EDI configuration
    http://www.erpgenie.com/sapgenie/docs/advanced_guide_to_edi_configuration.doc
    EDI Architecture
    http://www.cs.jyu.fi/el/tjtl63/Antin_esitys/sld003.htm
    Overview of EDI and the IDoc Interface in SAP
    http://sap-idoc2edi-consulting.com/pdfFiles/EDI_IDoc_Overview.pdf
    How to Build a Basic EDI Interface Using an Imported Schema and Map
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/818a20be-0601-0010-e3b8-ac3d5f975319
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d98675ca-0d01-0010-c5a0-c70389f1a314
    EDI Functional Design
    http://www.erpgenie.com/sapgenie/docs/interface_function_specification.doc
    Thoughts on EDI in an SAP XI Environment
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/135b0b94-0701-0010-f6a9-86a14057544a
    Workflow is a more basis related component. This component allows you to configure SAP system to trigger the mail straight to the Inbox of the manager. It can be related to approval of PR or PO or it can be of anyother purpose. The main purpose is the manager need not to login GUI screen for approval. He could select the approval button in his outlook mail(This mail will contain complete details of purchase order), it will automaticall update in SAP back end.
    Workflow will be per Business object. BO can be PR, PO etc.It is possible to set the event by when the workflow should trigger. For example it should trigger when the purchaser creates a PO and saves it . The saving action is called event. After the event is triggerred system will check for the starting conditions. It is possible to define starting condition per workflow. It is like your release strategy. If the value of PO is less than 1000 then it should be approved by one manager, if values >1000 then it should undergo approval from 2 managers.
    There are plenty of predefined workflows which could be used straigt according to the purpose expected.However workflow is delicate and has to be configured with utmost care in proper sequence to avoid in consistencies.
    Please follow the links,
    http://help.sap.com/saphelp_nw04s/helpdata/en/04/926f8546f311d189470000e829fbbd/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/c5/e4a930453d11d189430000e829fbbd/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a1/172437130e0d09e10000009b38f839/frameset.htm
    A good tutorial
    http://www.thespot4sap.com/articles/Invoice_Verification_Automation_Using_SAP_Workflow.asp
    http://www.sap-basis-abap.com/wf/sap-business-workflow.htm
    http://www.sap-img.com/workflow/sap-workflow.htm
    /people/alan.rickayzen/blog
    /people/jocelyn.dart/blog/2006/06/19/why-use-abap-oo-with-workflow
    a good book
    http://www.sap-press.com/product.cfm?account=&product=H950
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    Check the following PDF
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSTART/BCBMTWFMSTART.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMDEMO/BCBMTWFMDEMO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPM/BCBMTWFMPM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    Regards,
    Raj.

  • Include Idoc Script in another

    Hi,
    Do we have a way to include (like a library) an .idoc script inside another idoc script ?
    Thanks,
    Sunil

    Absolutely!
    iDocScript contains a feature called include. For more details see http://docs.oracle.com/cd/E23943_01/doc.1111/e10726/c02_application.htm#CSIDO118

  • Deleting several documents in idoc script

    Hello,
    I need some help about one of my customization.
    I would like to create a page on which a user would choose a website
    section and then after choosing it, all the documents of this website
    section would be deleted.
    So, in idoc script, I created a service called "DELETE_DOC_SCRIPTABLE"
    which is the same as "DELETE_DOC" but it is scriptable.
    I also created a service which retrieves all the documents and then I
    loop on the resultset generated and I call the service
    "DELETE_DOC_SCRIPTABLE".
    My first results is then deleted but then, after the first loop, UCM
    doesn't recognize my resultset anymore and so the other results are
    not deleted.
    Here is my code :
    <$loopwhile getValue("RST_DOCS_SECTION_A_SUPPRIMER","#isRowPresent")$>
    <$dID=RST_DOCS_SECTION_A_SUPPRIMER.dID$>
    <$executeService("DELETE_DOC_SCRIPTABLE")$>
    <$exec rsNext("RST_DOCS_SECTION_A_SUPPRIMER")$>
    <$endloop$>
    Here is my error in etc/log file
    "suppression_contenus
    /produits/ucmIntra/dev/custom/GestionSectionsSite/resources/gestionsectionssite_\
    ressources_supprimerContenus.htm
    [ligne 23, car 7]
    An error occured in the file
    '/produits/ucmIntra/dev/custom/GestionSectionsSite/resources/gestionsectionssite\
    _ressources_supprimerContenus.htm'
    q la ligne 98 et au caractre 10. Unable to evaluate the function
    'rsNext'. Unable to find result set 'RST_DOCS_SECTION_A_SUPPRIMER'.
    -> <$exec rsNext("RST_DOCS_SECTION_A_SUPPRIMER")$>
    -> <$endloop$>
    -> </table>
    Thank you in advance if you have any clue about this,
    Regards,
    Julian

    I`ve gotten a little bit closer by hacking at the code..
              <$rsMakeFromString( "rsDeleteDocsBydID", xdID, "dIDstored")$>
              <$numFields = rsNumRows("rsDeleteDocsBydID")$>
              <!-- numFields == <$numFields$> -->
              <!-- To Delete = <$dIDstored$> -->     
              [[%This Works when uncommented %]]
              <!--$dID = dIDstored$-->
              <!--$executeService("ETHER_DELETE_DOC")$-->
              [[%This does not execute the service again? - But returns dIDs correctly??%]]
              <$xnumFields = 0$>
              <$loopwhile xnumFields < numFields $>
                   [[%Recreate RS as Delete_doc service clears all RS?%]]
                   <$rsMakeFromString( "rsDeleteDocsBydID", xdID, "dIDstored")$>
                   <$exec rsSetRow("rsDeleteDocsBydID",xnumFields)$>
                   <$dID = dIDstored$>
                   <!-- Delete this dID = <$dID$> -->
                   <$executeService("ETHER_DELETE_DOC")$>
                   <$xnumFields =(xnumFields +1)$>
              <$endloop$>
    I may look at using the subservice DELETE_BYNAME anyone tried using this instead?
    Thanks

  • Can we execute an idoc script from a custom service?

    Is it possible to execute an idoc script while executing a custom service?
    -Pratap

    There are several ways to execute iDocScript from Java, but in this quick example we will use a PageMerger object. There are several ways to get ahold of a PageMerger object. If you are executing in a context where a service object is readily available you may be able to get a PageMerger object reference with code like this:
    PageMerger pm = m_service.m_pageMerger;
    If that doesn't work for you I would try something like:
    PageMerger pm = new PageMerger(databinder, executioncontext);
    Now that you have your merger object you can execute all kinds of iDocScript code, an example of which might be:
    pm.evaluateScript("<$lc(\"wwMyString\")$>");

  • Handle Idoc errors through workflow

    How  to handle inbound idoc  errors  through  workflow and How  to handle outbound idoc  errors  through  workflow
    Thanks,
    Asha

    in transaction SALE go to menu Basic Settings/Perform Automatic Workflow Customizing
    then in WE46 you can assign a workflow task to various errors
    in partner profiles (WE20) you can assign post processing agent per partner/message type

  • Idoc script function to count string

    Hi,
    Does anyone know if there is any build in function in idoc script to count the number of string.
    For example:
    A, B, C, D, E
    I want to count how many comma's are there using idoc script. If there is no build in function, what would be the best approach to achieve this.
    Many thanks.

    There is no built in function, but I would simply do this:
    <$rsMakeFromString("MyStringRS", "A, B, C, D, E")$>
    <$numCommas = MyStringRS.#numRows - 1$>
    Good Luck, and please award points as you see fit.

  • Idoc Script Study Material

    Hi,
    Can anyone suggest materail/book for Idco Script Starter
    Thanks
    AR
    Edited by: 838623 on Mar 29, 2011 2:25 AM

    Hi,
    Below URL provides entire Oracle UCM documentation http://download.oracle.com/docs/cd/E10316_01/ouc.htm
    Refer documentation for Idoc Script Reference Guide.
    Thanks,
    Ravinder

Maybe you are looking for