• Home
  • Blog
  • About
  • Archive
  • Wish List
  • ATOM 0.3
  • RSS 2.0
  •  

    How to Start a Workflow Process from PL/SQL block

    February 8th, 2006

    How to Start a Workflow Process from PL/SQL block

    You can call the Workflow Engine APIs to initiate a workflow process through the CreateProcess and StartProcess APIs if you want to perform additional tasks, such as setting item attributes, after creating and before starting the process. If you do not need to perform any additional tasks, you can use the LaunchProcess API, which is a wrapper combining the CreateProcess and StartProcess APIs.

    The procedure that executes the Workflow Engine APIs to initiate a process must identify the item type and item key of the process for these APIs. The item type and item key passed to these APIs uniquely identify an item and must be passed to subsequent API calls for each specific process. The process must begin with the standard Start activity or with another function, notification, or process activity, marked as a Start activity node.

    Oracle Workflow also includes a Launch Processes Web page for manually initiating workflow processes. The Launch Processes link is available from the Workflow home page in standalone Oracle Workflow or from a workflow administrator responsibility in embedded Oracle Workflow. It is intended for use by the workflow administrator to test workflow processes in a development environment.

    For more information, refer to the Workflow Engine APIs chapter in the Oracle Workflow API Reference

    Example:
    The following example shows how to initiate a process using the CreateProcess,
    SetItemUserKey, SetItemAttribute, SetItemOwner, and StartProcess APIs.

    function&nbsp;test_wf_calling&nbsp;()<br />&nbsp;&nbsp;&nbsp;l_itemtype&nbsp;varchar2(15);<br />&nbsp;&nbsp;&nbsp;l_itemkey&nbsp;&nbsp;varchar2(15);&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;some&nbsp;unique&nbsp;key<br />begin<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;l_itemtype&nbsp;:=&nbsp;'NEW_TASK';&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;--&nbsp;code&nbsp;to&nbsp;have&nbsp;some&nbsp;unique&nbsp;key&nbsp;for&nbsp;this&nbsp;process&nbsp;instance<br />&nbsp;&nbsp;&nbsp;l_itemkey&nbsp;:=&nbsp;'something';&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;--&nbsp;which&nbsp;process&nbsp;of&nbsp;the&nbsp;workflow&nbsp;you&nbsp;want&nbsp;to&nbsp;start?<br />&nbsp;&nbsp;&nbsp;wf_engine.CreateProcess&nbsp;(&nbsp;&nbsp;ItemType&nbsp;=&gt;&nbsp;l_itemtype,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ItemKey&nbsp;&nbsp;=&gt;&nbsp;l_itemkey,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process&nbsp;&nbsp;=&gt;&nbsp;'MAIN_PROCESS');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;--&nbsp;set&nbsp;user&nbsp;key<br />&nbsp;&nbsp;&nbsp;wf_engine.SetItemUserKey&nbsp;(&nbsp;ItemType&nbsp;=&gt;&nbsp;l_itemtype,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;wf_engine.startprocess(itemtype&nbsp;=&gt;&nbsp;l_itemtype,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itemkey&nbsp;=&gt;&nbsp;l_itemkey);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />end;

    Stay tuned for more detailed example…


    Sharing happiness

    February 8th, 2006

    Two men, both seriously ill, occupied the same hospital room. One man was allowed to sit up in his bed for an hour each afternoon to help drain the fluid from his lungs. His bed was next to the room’s only window. The other man had to spend all his time flat on his back. The men talked for hours on end. They spoke of their wives and families, their homes, their jobs, their involvement in the military service, where they had been on vacation.

    Every afternoon when the man in the bed by the window could sit up, he would pass the time by describing to his roommate all the things he could see outside the window.  The man in the other bed began to live for those one-hour periods where his world would be broadened and enlivened by all the activity and color of the world outside.

    The window overlooked a park with a lovely lake. Ducks and swans played on the water while children sailed their model boats. Young lovers walked arm in arm amidst flowers of every color and a fine view of the city skyline could be seen in the distance.

    As the man by the window described all this in exquisite detail, the man on the other side of the room would close his eyes and imagine the picturesque scene. One warm afternoon the man by the window described a parade passing by. Although the other man couldn’t hear the band - he could see it. In his mind’s eye as the gentleman by the window portrayed it with descriptive words.

    Days and weeks passed. One morning, the day nurse arrived to bring water for their baths only to find the lifeless body of the man by the window, who had died peacefully in his sleep. She was saddened and called the hospital attendants to take the body away. As soon as it seemed appropriate, the other man asked if he could be moved next to the window.

    The nurse was happy to make the switch, and after making sure he was comfortable, she left him alone. Slowly, painfully, he propped himself up on one elbow to take his first look at the real world outside. He strained to slowly turn to look out the window beside the bed.

    It faced a blank wall. The man asked the nurse what could have compelled his deceased roommate who had described such wonderful things outside this window. The nurse responded that the man was blind and could not even see the wall. She said, “Perhaps he just wanted to encourage you.”

    Epilogue:

    *”There is tremendous happiness in making others happy, despite our own situations”*

    *”Shared grief is half the sorrow, but happiness when shared, is doubled”*

    *”If you want to feel rich, just count all the things you have that money can’t buy”*

    *”Today is a gift, that’s why it is called the present.” *

    Source: Email


    ONE PARAGRAPH THAT EXPLAINS LIFE!

    February 8th, 2006

    ONE PARAGRAPH THAT EXPLAINS LIFE!

    Arthur Ashe, the legendary Wimbledon player was dying of AIDS which he got due to infected blood he received during a heart surgery in 1983. From
    world over, he received letters from his fans, one of which conveyed: “Why does GOD have to select you for such a bad disease”?

    To this Arthur Ashe replied: The world over — 5 crore children start playing tennis, 50 lakh learn to play tennis, 5 lakh learn professional
    tennis, 50,000 come to the circuit, 5000 reach the grand slam, 50 reach Wimbledon, 4 to semi final, 2 to the finals, when I was holding a cup I
    never asked GOD “Why me?”, And today in pain I should not be asking GOD “Why me?”

    Happiness keeps u Sweet, Trials keep u Strong, Sorrow keeps u Human, Failure Keeps u Humble, Success keeps u Glowing, But only God Keeps u
    Going…..

    Keep Going…..

    Source: Email


    Haircut Of The Year

    February 8th, 2006

    haircut.jpg

    Unfortunately my hair is not so hard! Otherwise I would have given him a competition Image


    Close
    E-mail It