Thursday, September 30, 2010

Getting User Information - Advanced Workflow Features

Oracle Enterprise Content Management uses a built in Workflow tool for routing documents to individuals or groups of users for approval/rejection and editing.  While workflows can be created with predefined user participants, it is best to use Aliases or Tokens. 

·       Aliases are groups of users, managed through the ECM User Administration tool, which allows administrators to group people for a particular task or for notifications. 

·       Tokens are extremely powerful variable-like objects which administrators can use to dynamically set workflow participants.

A common use case for Tokens is in the development of AdHoc workflows.  When a user checks in a document, they can use Metadata to select an alias or user to participate in the workflow for that document.  However, tokens can be used for more advanced workflow tasks. 

Within Workflow steps, there are three levels of events that administrators can use for extended functionality and business processing of workflow logic. 

·       Entry Event is used to evaluate content conditions as the document is just entering the workflow.  For example, if a document was rejected from another step and the rejection logic routed it to this particular step, the Entry Event could test for rejection and update a metadata field.

·       Update Event is used to evaluate content actions while the document is in process of the current workflow step.  For example, if an administrator wants to automatically approve a document which is edited by a particular user during the step, this event would facilitate that.

·       Exit Event is used to evaluate content conditions as the content is leaving a particular workflow step.  For example, if an administrator wants to update a metadata field of a document as it is leaving the workflow, maybe changing a custom metadata field of xstatus to approved, this is the event where those tasks can be performed.

In some cases, Components may be required to enhance the out-of-the-box functionality of the ECM.  Components are modular programs written in IDOC script, JAVA, or a combination of the two that adds new functions to the application or enhances/alters what was originally created.  An example of a custom component might include adding an icon to Search Results if a document has an associated Discussion (See next week’s blog for an example of how to do this).

The following is an advanced example of using both Tokens and Workflow Events along with a custom Component.

Situation: An administrator wants to create a workflow where the participating users are dynamically derived based upon  a particular Security Roles that users belong to.

Issue:  UCM variable like UserName, UserFullName, UserAddress, and functions like getUserValue, getValueForSpecifiedUser, isUserOverrideSet, userHasAccessToAccount, userHasGroupPrivilege, and userHasRole only retrieve information about the currently logged in user.  As the Situation statement indicates, the administrator wants to test against all users to determine which user has a specific role and add those users to the workflow step.  The desired information is not currently available in the ECM. 

Solution: In order to facilitate the request, we need to first create a new Custom Component, create a Workflow Token, and create a workflow Entry Event.

Creating the Component:



1.       Luanch the Component Wizard application and select Add from the Component List window.  Make sure the Create New Component checkbox is checked and name the Component Workflow_Example.




2.       We will create a query that will enable administrators to query against the usersecurityattributes table then provide a result set that can be looped through to find the desired users.  Click on Add and select the radio button for Query.



After clicking Next two times, we can add the Query name, calling it quserattribute (as best practice, always start query names with q). On the next screen, enter the query script and a parameter to pass into the query script: select dattributename from usersecurityattributes where dattributetype = 'role' and dusername = ?.



Click Ok to continue


Click OK to continue. 

3.       Next, you will need to create a service which calls the query and stores the information into a specific Result Set.  From the main page of the Component Wizard, click Add on the left and select Service.



Click Next two times.  Name the new service find_user and assign the DocService as the service class.



Make the Access Level Read and Scriptable.  Next click the Add button.  On the next screen, make Type equal Select cache query, Action equal quserattribute, enter NameLoop in the parameters box, and check box for check result non-empty.  Put No Data Found in the Error Message Line. 



Click OK to continue then click Finish.  When Prompted to edit, select No.

4.        Enable the component and restart the ECM server.

Creating the Token:

We will need a Workflow for our example.  In the ECM interface, go to Admin  Applets and launch Workflow Admin.  Create a new Criteria Workflow.



Once this is created, we are ready to create the Token:

1.           From the workflow menu, select Options, Token, and then click on Add.  Enter the Token Name as wk_example_token and a Description of Workflow Example Token.



2.       On the same screen, put has the following code into the Users box: <$wfAddUser(wfGet("xuserlist"), “user”)$>   

Click Ok and then Close.

To keep the example simple, we’ll create a single workflow step that uses the newly created Token to insert users who have the Role admin.

1.       With your workflow highlighted in the left hand side of the window, click Add on the right.  In the new window, put Example into the Name and Description fields.  Leave Users can review the current revision selected.  Click on Add Token and select the token you just created.



2.       Click on the Events tab.  Select the Custom Tab and click the Custom Script Expression check box.  Enter the following code: 

<$getViewValuesResultSet("docAuthors","","")$><!-- this code retreives all the known users-->

<$xuserlist=""$> <!-- this establishes the xuserlist variable with no value assigned to it-->

<$xcount=0$> <!-- it is typical to use a loop counter when trying to values and to control the looping -->

       <$loop SchemaData$> <!-- this begins the looping of the known users -->

                             <$executeService("find_user")$> <!-- this calls the service created for this example,
                                                                                                the Schemadata loop automatically assigned the parameter of dName which this service uses -->

                                           <$loop NameLoop$> <!-- this starts the loop of results from the query results in the find_user service -->

                                                          <$if strIndexOf(dAttributeName,"admin") >= 0  $> <!-- this checks for the result to see if the Role admin is there -->

                                                                        <$if xcount < 1$>  <!-- checks to see if this is the first time through the loop -->
                                                                                      <$xuserlist=dName$> <!-- assigns the variable xuserlist with the userID which has admin Role -->

                                                                        <$else$> <!-- test to see if there are more user to loop through -->

                                                                                      <$xtempuserlist=xuserlist$> <!-- creates a temp holding for all the users found so far -->

                                                                                      <$xuserlist="" & xtempuserlist & " , " & dName$> <!-- add the next user to xuserlist with a , seperator -->

                                                                        <$endif$> <!-- closes the test -->

                                                                        <$xcount = xcount + 1$> <!-- increments the loop count -->

                                                                        <$break$>


                                                          <$endif$>          

                                           <$endloop$>

       <$endloop$>

<$wfSet("xuserlist",xuserlist)$>  <!-- This applies the users to the token-->



Click OK two times and enable the workflow.

3.       Check in a document matching your workflow criteria to test the workflow.
4.       Go to Workflow Assignments to ensure the document is in the que.


5.       From the Actions left-hand icon, click on Workflow Info.  You should see all the users that matched the criteria:


80 comments:

  1. I agree with your thoughts!!! As the demand of java programming application keeps on increasing, there is massive demand for java professionals in software development industries. Thus, taking training will assist students to be skilled java developers in leading MNCs.Best Java Training in Chennai | JAVATraining Institutes in Chennai

    ReplyDelete
    Replies
    1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. Showbox is one of the best apps among all the others which provide streaming of movies and tv shows.
    The best part is, it is absolutely free for everyone and it also provides multiple resolutions of the videos.
    You can also watch the videos even when you are offline
    If you face any kind of trouble during movies downloading and you want to see latest movies in HD format then you need an app like Showbox.
    Nowadays this app is getting much popular because of its attractive and trendy
    ShowBox for PC

    ReplyDelete
  3. This article provides the information about Java its key features and scope for java professionals. This information is really helpful me to know more about Java programming language. Java Training in Chennai | Java Training | Java Course in Chennai

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Best Hadoop Training Institute In chennai

    ReplyDelete
  6. Nice article Thanks for sharing this article Wonderful information from this website Thanks !!!

    Embedded system training in chennai | PLC training institute in chennai

    ReplyDelete
  7. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.AWS Training in chennai

    ReplyDelete
  8. The article you have shared here very good. This is really interesting information for me. Thanks for sharing!
    shell shockers

    ReplyDelete
  9. من أجل التخلص من البقع وتنظيف الأثاث للعودة إلى الطبيعة ، ستحتاج إلى أدوات ومنظفات خاصة ، بالإضافة إلى يد عاملة مدربة تدريباً جيداً لمساعدتك في القيام بهذا العمل الشاق ، الذي تقوم به Damam City Cleaning شركة دمياط ومختم للتنظيف تقومان بكل العمل الشاق.
    شركة النجوم لخدمات التنظيف
    شركة تنظيف فلل بالرياض
    شركة عزل خزانات بالرياض
    شركة جلي بلاط بالرياض

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. good..I would like to thank you for sharing this valuable information
    big data training in chennai

    ReplyDelete
  12. awesome blog.
    https://www.inplanttrainingchennai.com/freeinplanttrainingcourseforECEstudents.html
    https://www.inplanttrainingchennai.com/inplant-training-in-it.html
    https://www.inplanttrainingchennai.com/internship-in-chennai-for-bsc.html
    https://www.inplanttrainingchennai.com/inplant-training-for-automobile-engineering-students.html
    https://www.inplanttrainingchennai.com/freeinplanttrainingfor-ECEstudents-in-chennai.html
    https://www.inplanttrainingchennai.com/internship-for-cse-students-in-bsnl.html
    https://www.inplanttrainingchennai.com/inplant-training-in-ece.html
    https://www.inplanttrainingchennai.com/application-for-industrial-training.html
    https://www.inplanttrainingchennai.com/best-inplant-training-in-chennai-for-CSE-student.html
    https://www.inplanttrainingchennai.com/implant-training-for-biotechnology-students.html

    ReplyDelete
  13. Very interesting information blog post, my favorite this post, thanks a lot for these amazing content.
    Assignment Help
    Online Assignment Help

    ReplyDelete
  14. Whereas, if trees or palms are from the affected areas, a trench is made about 50 cm from the area of ​​infection and pumped with a termite repellent with insecticides that do not have any effect on the fertility of agricultural land.
    شركة مكافحة النمل الابيض
    شركة مكافحة النمل الابيض بالطائف
    شركة مكافحة حشرات بالطائف
    شركة رش مبيدات بالطائف

    ReplyDelete
  15. Thanks Admin For sharing this massive info with us. it seems you have put more effort to write this blog , I gained more knowledge from your blog. Keep Doing..
    Regards, thanks a lot guys
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  16. Very Good Blog. Highly valuable information have been shared.Great information has been shared. We expect many more blogs from the author. Special thanks for sharing.

    selenium training in chennai

    selenium training in chennai

    selenium online training in chennai

    selenium training in bangalore

    selenium training in hyderabad

    selenium training in coimbatore

    selenium online training


    ReplyDelete
  17. Thanks for your extraordinary blog. Your idea for this was so brilliant. This would provide people with an excellent tally resource from someone who has experienced such issues. You would be coming at the subject from a different angle and people would appreciate your honesty and frankness. Good luck for your next blogI am very grateful to read your blog.I hope you would provide the great services in the field of website design and development and Search Engine Optimization. Thank for the share.
    Java training in Chennai

    Java Online training in Chennai

    Java Course in Chennai

    Best JAVA Training Institutes in Chennai

    Java training in Bangalore

    Java training in Hyderabad

    Java Training in Coimbatore

    Java Training

    Java Online Training

    ReplyDelete
  18. Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
    Azure Training in Chennai

    Azure Training in Bangalore

    Azure Training in Hyderabad

    Azure Training in Pune

    Azure Training | microsoft azure certification | Azure Online Training Course

    Azure Online Training

    ReplyDelete
  19. wow nice blog, Kindly Keep sharing such blogs and review and also Kindly go through for corporate outing with adventure nest.we provide great team building activities and a lot of adventure games.
    DevOps Training in Chennai

    DevOps Online Training in Chennai

    DevOps Training in Bangalore

    DevOps Training in Hyderabad

    DevOps Training in Coimbatore

    DevOps Training

    DevOps Online Training

    ReplyDelete
  20. Great site and a great topic as well I really get amazed to read this.This is incredible,I feel really happy to have seen your webpage.I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.
    Full Stack Training in Chennai | Certification | Online Training Course
    Full Stack Training in Bangalore | Certification | Online Training Course

    Full Stack Training in Hyderabad | Certification | Online Training Course
    Full Stack Developer Training in Chennai | Mean Stack Developer Training in Chennai
    Full Stack Training

    Full Stack Online Training




    ReplyDelete
  21. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    Data Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  22. I feel really happy to have seen your webpage.I am feeling grateful to read this.you gave a nice information for us.please updating more stuff content...keep up!!

    Android Training in Chennai

    Android Online Training in Chennai

    Android Training in Bangalore

    Android Training in Hyderabad

    Android Training in Coimbatore

    Android Training

    Android Online Training

    ReplyDelete
  23. very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    IELTS Coaching in chennai

    German Classes in Chennai

    GRE Coaching Classes in Chennai

    TOEFL Coaching in Chennai

    spoken english classes in chennai | Communication training

    ReplyDelete
  24. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.



    AWS Course in Bangalore

    AWS Course in Hyderabad

    AWS Course in Coimbatore

    AWS Course

    AWS Certification Course

    AWS Certification Training

    AWS Online Training

    AWS Training

    ReplyDelete
  25. Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

    Security Guard License
    Ontario Security License
    Security License Ontario
    Security License

    Thank you..

    ReplyDelete