<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WorkflowFAQ &#187; Functional</title>
	<atom:link href="http://www.workflowfaq.com/category/oracle/functional/feed" rel="self" type="application/rss+xml" />
	<link>http://www.workflowfaq.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 07:00:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Can I change the display name for an attachment link?</title>
		<link>http://www.workflowfaq.com/can-i-change-the-display-name-for-an-attachment-link</link>
		<comments>http://www.workflowfaq.com/can-i-change-the-display-name-for-an-attachment-link#comments</comments>
		<pubDate>Sun, 22 Jan 2012 12:04:14 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[documents]]></category>
		<category><![CDATA[notifications]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=647</guid>
		<description><![CDATA[Some time last year, I was asked about adding different attachments to notifications &#8211; something that has been discussed in the forum a number of times. This time, I was asked about whether it was possible to modify the display name, so that each attachment link contained the name of the file that had been [...]]]></description>
			<content:encoded><![CDATA[<p>Some time last year, I was asked about adding different attachments to notifications &#8211; something that has been discussed in the forum a number of times. This time, I was asked about whether it was possible to modify the display name, so that each attachment link contained the name of the file that had been attached:</p>
<blockquote><p>Hello</p>
<p>I have a requirement to send a notification with attachment but attachment name should be attachment name. Is there any way to change the display name of the Attachment?</p></blockquote>
<p>This is something that was also asked in the <a href="http://smforum.workflowfaq.com/index.php?topic=1589.msg4104#msg4104">forum in June last year</a> &#8211; where there are multiple attachments (or even if there is a single attachment), users like to see the details of the attachment rather than a generic &#8220;attached file&#8221; link, for example.</p>
<p>When the notification is built, any attached documents are included as attributes to the message.  The link to the attachment is created using the display name for the attribute in the text.  It is possible to modify the display name of an attribute programmatically (although this is NOT supported by Oracle since it would be a direct table update), BUT attributes aren&#8217;t versioned.  There is only one definition of an attribute within the process definition, so if we changed the display name, this would impact EVERY notification that uses the same message.</p>
<p>So, the quick and simple answer is &#8220;No&#8221;, and hopefully this quick post explains why you can&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/can-i-change-the-display-name-for-an-attachment-link/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can I stop one notification going by email to one particular person?</title>
		<link>http://www.workflowfaq.com/how-can-i-stop-one-notification-going-by-email-to-one-particular-person</link>
		<comments>http://www.workflowfaq.com/how-can-i-stop-one-notification-going-by-email-to-one-particular-person#comments</comments>
		<pubDate>Fri, 07 Oct 2011 09:06:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[pnf]]></category>
		<category><![CDATA[suppress]]></category>
		<category><![CDATA[triggers]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=614</guid>
		<description><![CDATA[I was asked recently whether there was any way to stop one particular notification going to one particular user via email &#8211; the user wanted to receive all their other notifications via email, but not this one. Since the user wanted to receive all their other notifications via email, it wasn&#8217;t a case of being [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked recently whether there was any way to stop one particular notification going to one particular user via email &#8211; the user wanted to receive all their other notifications via email, but not this one.</p>
<p>Since the user wanted to receive all their other notifications via email, it wasn&#8217;t a case of being able to change their notification preference, since that would stop all the others going out as well. &nbsp;We could consider flicking the profile before sending the notification and then changing it back immediately afterwards, but I&#8217;m not convinced that&nbsp;this would work. &nbsp;Also, it&#8217;s a pretty intrusive change to make to process, since you would need new logic before and after the notification activity.</p>
<p>So, there are two other ways that the client could do this.</p>
<p>Firstly, they could write a trigger on WF_NOTIFICATIONS which fires when a new notification is created. &nbsp;The trigger would check whether the recipient is the user we are interested in and the notification type being created, and if so&nbsp;immediately&nbsp;set the MAIL_STATUS to SENT. &nbsp;This would fool the mailer into believing that the notification had already been emailed, so would never go out via email.</p>
<p>The second approach would be to change the Workflow definition and include a post notification function for the one notification which performs the same logic &#8211; if the user is the one person who doesn&#8217;t want to receive the notification via email, then update the MAIL_STATUS to SENT again to stop the email being sent.</p>
<p>Both of these approaches have pros and cons. &nbsp;Creating a trigger on the table may introduce a performance overhead &#8211; every notification which is created would need to be checked to determine whether to suppress the email being sent. &nbsp;Creating a post-notification function means that changes need to be made to the Workflow definition, and the support guidelines would need to be checked before making changes to a seeded notification. &nbsp;Also, if the notification already has a post notification function, then you would need to either change that PNF, or create a wrapper which calls the original PNF and then does the new logic.</p>
<p>There were three questions that I put to the client before recommending an approach to adopt:</p>
<ol>
<li>Is it possible / likely that more than one user will want this functionality?</li>
<li>Is is possible / likely that the users might change their minds about whether they want this enabled or disabled?</li>
<li>Is it possible / likely that the user(s) might want to include different notifications?</li>
</ol>
<p>If the answer to the last question is &#8220;No&#8221;, then I would change the existing Workflow definition and include a post notification function. &nbsp;If the answers to the other questions are &#8220;Yes&#8221;, but it still only applies to one notification, then I would still create a PNF to perform the logic, but build extra flexibility into the logic. &nbsp;For example, I would also have a profile option set at the right level which indicates whether emails should be suppressed or not, which provides flexibility and ease of use to enable / disable the suppression of emails via the front-end screens rather than needing a coding change.</p>
<p>If, however, the answer to the last question is &#8220;Yes&#8221;, then I would define a trigger on the table which can then fire under multiple scenarios. &nbsp;I would define a value set which dictates which notifications should be suppressed (either for a whole item type or on an individual notification basis), and have the trigger check the value set first to see whether this notification is one where email might not be needed. &nbsp;If the notification is one which shouldn&#8217;t be emailed, then again I would have a profile option for the user / responsibility / org / site which determines whether this particular notification should not be emailed. &nbsp;This may be more processor intensive than a quick and easy check of one thing, but it provides the most flexibility to the solution &#8211; no coding changes are required to add / remove notifications or people to the list, which means that changes can be implemented quickly and easily without the need for further testing to be performed.</p>
<p>In the end, the client adopted the post notification function approach and decided not to make it widely known that this was a possibility. &nbsp;It may be that in future years, more notifications / users are required, at which point they should revisit the recommendations and switch to the trigger approach. &nbsp;There is nothing wrong with the way they have gone &#8211; it meets their current requirements, but if those requirements change significantly in the future then a review will be required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/how-can-i-stop-one-notification-going-by-email-to-one-particular-person/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reusing a process in Workflow</title>
		<link>http://www.workflowfaq.com/reusing-a-process-in-workflow</link>
		<comments>http://www.workflowfaq.com/reusing-a-process-in-workflow#comments</comments>
		<pubDate>Fri, 30 Sep 2011 13:41:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[child]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[parent]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[re-use]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[war stories]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=544</guid>
		<description><![CDATA[I was recently a question which took me back to my very first Workflow project where we needed to re-use a sub-process repeatedly: When I try to save the workflow, I am getting the error below: WFPACTV_FAIL OPERATION=SAVE NAME=XXOM_P_VLVS_LN_FLW_GEN_SCH_DEF TYPE=OEOL WFPACRV_REUSE_PROCESS NAME=XXOM_P_ASSIGN_VS_SO_LINE What&#8217;s the problem? The error is caused because Workflow will not allow the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently a question which took me back to my very first Workflow project where we needed to re-use a sub-process repeatedly:</p>
<blockquote><p>When I try to save the workflow, I am getting the error below:<br />
WFPACTV_FAIL OPERATION=SAVE NAME=XXOM_P_VLVS_LN_FLW_GEN_SCH_DEF TYPE=OEOL<br />
WFPACRV_REUSE_PROCESS NAME=XXOM_P_ASSIGN_VS_SO_LINE</p></blockquote>
<p><span style="text-decoration: underline;"><strong>What&#8217;s the problem?</strong></span></p>
<p>The error is caused because Workflow will not allow the developer to re-use a sub-process within the same hierarchy, i.e. Start -&gt; SUB1 -&gt; SUB2 -&gt; SUB1 -&gt; End. &nbsp;When I did my first Workflow project, we had a very complex process flow which managed sending messages via AQ from one system to a transformation hub, which then passed them onto a back-office system. &nbsp;What was a simple message from the front-end became a series of simple messages in the back-end, and Workflow was used to manage the co-ordination between the systems.</p>
<p>What we found, however, was that in the front-end, we could build a message which allowed the user to enter a mailing address for the customer, for the product that the customer was buying (so different products could be posted to different addresses), for a proxy for a product and so forth &#8211; essentially we had four or five different levels where we wanted to do the same thing. &nbsp;Unfortunately, because the &#8220;create an address&#8221; process could be called a number of times within the same hierarchy, we hit the limitation in Workflow that you cannot reuse the process. &nbsp;As a workaround, we ended up creating copies of the sub-process and naming them differently (we added a different letter to the name), which became pretty annoying when it came to maintenance later on &#8211; if we had to make a change to one sub-process, we had to make sure that we were making the same change to each copy as well&#8230;.</p>
<p><span style="text-decoration: underline;"><strong>Why can&#8217;t you do it?</strong></span></p>
<p>Here&#8217;s the background about WHY you can&#8217;t do it &#8211; feel free to skip ahead to my thoughts on bypassing the problem now.</p>
<p>Because of the way that the Workflow definition is stored in the database, if the same process is re-used, there is no way that the Workflow Engine can determine which time through the activities are being run. &nbsp;For a single activity, when it is revisited, the previous visit is archived in the Workflow history tables. &nbsp;For a series of activities (i.e. a sub-process), the same holds true when it is revisited &#8211; the whole process is recorded in the history tables. &nbsp;However, there is a big difference between revisiting a process and reusing it. &nbsp;If you are reusing the process, then there is nothing to archive &#8211; the previous use should remain in the current run. &nbsp;When the activity then completes, the WF_ITEM_ACTIVITY_STATUSES table would have two records for the same activity &#8211; the first run and then the re-used process. &nbsp;Sadly, the code which manages the update cannot take the two into account, so wouldn&#8217;t know which record to update.</p>
<p>If Workflow was being written today, then if the activity statuses used TIMESTAMP rather than a DATE to store the execution time (or even included a sequence number), then the Workflow Engine could more easily determine which record to update, to help bypass this limitation. &nbsp;However, if you had a parallel branch, which routed to two identical re-used processes (I can&#8217;t see <em>WHY</em> you would do that, but it could be possible), then you hit the same limitation again &#8211; how do you identify within the Workflow tables which activity in the process is running??? &nbsp;Overall, it makes sense to include the limitation, IMO.</p>
<p><span style="text-decoration: underline;"><strong>Ways Round The Problem</strong></span></p>
<p>If there are only going to be a limited number of times that the process is going to be re-used, then I would be inclined to make a copy of the process and rename it slightly and use that. &nbsp;That process is significantly easier if you know that the process is finalized, so that you won&#8217;t be needing to make the same change to multiple copies. &nbsp;If you are going this route, then you need to ensure that the different process copies are sufficiently clearly labelled / documented / commented to allow you (or someone else) to maintain the definition going forwards.</p>
<p>If there are a large number of processes that need to be copied (I remember having copies A through to K of one sub-process!), then I would define the process as a separate, runnable process which is invoked as a child process with it&#8217;s own item type and item key. &nbsp;There are no limitations on the number of times that the process can be re-used, and if the process is still in the same item type, then when it is created, the item attribute definitions will be the same &#8211; you just need to include something in your code which copies them from one instance to another.</p>
<p>One downside of implementing a parent-child relationship, however, is that when you look at the entire history of the process, it isn&#8217;t going to be all in one place &#8211; there will be some parts recorded in one process and others in other bits. &nbsp;Also, I would be wary of using the standard WAITFORFLOW / CONTINUEFLOW activities to manage the flow, if there is a way that there could be more than one waiting process. &nbsp;Instead, I would define some custom business events &#8211; have the main flow wait to receive the event, and the child flows raise the event. &nbsp;This way, when you raise the event, you can pass attribute values easily back into the parent without having to directly call the WF_ENGINE APIs.</p>
<p>&nbsp;</p>
<p>If I were building that first project from scratch, there are many things that I would change. &nbsp;This would definitely be one of those.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/reusing-a-process-in-workflow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why isn&#8217;t the approval history available to all members of a role?</title>
		<link>http://www.workflowfaq.com/why-isnt-the-approval-history-available-to-all-members-of-a-role</link>
		<comments>http://www.workflowfaq.com/why-isnt-the-approval-history-available-to-all-members-of-a-role#comments</comments>
		<pubDate>Sun, 25 Sep 2011 11:59:36 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[approval]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[pnf]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=555</guid>
		<description><![CDATA[I recently had an email asking for help with trying to work out why a notification wasn&#8217;t showing the approval history: I have a custom Workflow which has notification where in I am using Adhoc role to send notification to multiple users. The Expand roles checkbox is checked. Now the issue is the Action History [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an email asking for help with trying to work out why a notification wasn&#8217;t showing the approval history:</p>
<blockquote><p>I have a custom Workflow which has notification where in I am using Adhoc role to send notification to multiple users. The Expand roles checkbox is checked.<br />
Now the issue is the Action History table which comes in the approval notifications does not appear in the notification sent to each user.  The history is visible to the user who was added first to the adhoc role (where the Notification Group ID = Notification ID), but for all the other users the history table itself is not shown in the notification.</p>
<p>I have tried using WF_NOTIFICATION(HISTORY) in the workflow message but this is unsuccessful.</p></blockquote>
<p>This intrigued me for a while about why the history would appear for one user but not for any others, when the content should obviously be the same.  Then I considered the issue a bit more, and this turns out to be standard functionality.</p>
<p>Here&#8217;s a more detailed scenario.  A notification is sent to a role, which has four users assigned to the role.  The notification requires a response, and the &#8220;Expand Roles&#8221; checkbox is ticked so that each user receives their own copy of the notification.  The notification is accepted as approved when either 75% of the recipients have approved it or 50% have rejected it.  Within the notification, there is a history table.  Over the following few days, the following activities take place:</p>
<ul>
<li>Day 1 &#8211; Within five minutes of receiving the notification, the first approver responds with an approval.</li>
<li>Day 1 &#8211; Within five minutes of receiving the notification, the fourth approver rejects the notification.</li>
<li>Day 2 - The second approver asks for more information from the person who submitted the request.</li>
<li>Day 2 &#8211; The third approver asks for more information from the first approver.</li>
<li>Day 3 &#8211; The first approver answers the question from the third approver.</li>
<li>Day 5 &#8211; The person who submitted the request responds to the question from the second approver.</li>
<li>Day 5 &#8211; The second approver approves the request.</li>
<li>Approval / rejection from the third approver is still outstanding.</li>
</ul>
<p>At this stage, what should the approval history be showing?  As far as the Workflow process is concerned, the notification (although they all have different notification IDs) can only have one history.  So, what is the history?  Is the history of the notification which was sent to the first approver the same as that sent to the second?</p>
<p>At some stage, the Workflow product development team decided that it made sense that a notification could only have one history, therefore even when the role was expanded, only the first person in the role would have the history.  So, what was happening was expected functionality &#8211; only that one person will generate history in the notification.   (It turns out that there is a brief mention of this being standard functionality in Metalink note 431219.1)</p>
<p><span style="text-decoration: underline;"><strong>So, what can be done about it?</strong></span></p>
<p>There isn&#8217;t much that can really be done to circumvent the standard functionality.  I discussed the issue with another Certified Workflow Expert that I know and bounced a few ideas back and forth.</p>
<p>The first suggestion he made was to use the special attribute #RELATED_HISTORY on the notification, which allows you to include the history from one notification in another notification.  His thoughts were that if a post notification function were included, it might be possible to set the attribute on the second and third copies so that they include the history of the first approval notification.  However, when we looked at it a bit more, it became obvious that this idea won&#8217;t work.  The #RELATED_HISTORY attribute can only be used to associate different notifications together, since it needs to be set to the label for the notification to relate, and the attribute only works on an FYI notification.</p>
<p>The next suggestion was that a single notification could be sent (i.e. without expanding the roles) to an email distribution list.  This would allow the user to receive what appears to be their own copy of the notification and act on it, but means that there is no way that the voting requirements could be met, and would only allow a response via email if the flag was set to allow forwarded responses, since any response would come from a different email address to the one that was notified.  Depending on the exact business requirements, this may or may not meet the bill.</p>
<p>So, it comes to the final suggestion.  Rather than including the standard history within the notification, we could suppress it from the first notification and then replace it with a custom table.  Including an attribute as a PL/SQL document in the code to generate a table which provides the history of all the notifications would enable all copies of the notification to include an up-to-date history for all copies of the notification.  Setting the document ID to equal the notification ID would mean that you can programmatically determine the group ID for the notification and build a complete history of the process.</p>
<p>This turned out to be the solution that the client wanted, needed and implemented in the end, but for some clients it would be overkill.  I&#8217;ll ask for some screenshots to include, but am not hopeful given their penchant for security &#8211; failing that, I&#8217;ll try to come up with some examples of how we did it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/why-isnt-the-approval-history-available-to-all-members-of-a-role/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why isn&#8217;t the Workflow Owner an LOV in the admin pages?</title>
		<link>http://www.workflowfaq.com/why-isnt-the-workflow-owner-an-lov-in-the-admin-pages</link>
		<comments>http://www.workflowfaq.com/why-isnt-the-workflow-owner-an-lov-in-the-admin-pages#comments</comments>
		<pubDate>Fri, 09 Sep 2011 19:34:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[Responsibilities]]></category>
		<category><![CDATA[searching]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=619</guid>
		<description><![CDATA[I was recently asked about why the LOV for Workflow owner wasn&#8217;t &#8220;working&#8221; for a user: &#8230;Everything is working fine except the fact that when I go to the notifications Page from the WF Admin responsibility, I can only search for my own Workflows.  I can enter the Item Type and the internal name, but the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked about why the LOV for Workflow owner wasn&#8217;t &#8220;working&#8221; for a user:</p>
<blockquote><p>&#8230;Everything is working fine except the fact that when I go to the notifications Page from the WF Admin responsibility, I can only search for my own Workflows.  I can enter the Item Type and the internal name, but the field Workflow Owned By is not a LOV.  The field is appearing as a hard-coded value of my user name, so I cannot see any processes launched by anyone else.</p></blockquote>
<p>The answer is that the ability to view processes which are owned by another user is restricted to either the user who has been set as the Workflow administrator, or if the administrator is set to a responsibility the user has been granted that responsibility.</p>
<p>In this case, the user was telling me that they had been granted the &#8220;WF Admin responsibility&#8221;, but that isn&#8217;t necessarily the same as being a Workflow administrator.  For example, the Workflow administrator might have been set to be an individual user (in standalone Workflow this was always set as SYSADMIN as standard).</p>
<p>If you have been granted the standard Workflow Administrator responsibility, you will be able to navigate the administration pages, although you won&#8217;t be able to modify any of those settings.  So, navigate to the Admin tab, which will show you who is the current administrator or which responsibility has been set:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-621" title="WF Admin Screen - not set as the administrator" src="http://www.workflowfaq.com/wp-content/uploads/2011/09/WF-Admin-Screen-1.jpg" alt="" width="486" height="183" /></p>
<p>In the above image, the user has used the Workflow Administrator responsibility to navigate to the administration tab, but cannot make any changes because they do not have the responsibility to perform any admin tasks.  If I grant the &#8220;Workflow Administrator Web (New)&#8221; responsibility to the user and refresh the page, I can now make changes because I now have the right access:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-620" title="WF Admin Screen - now with admin rights" src="http://www.workflowfaq.com/wp-content/uploads/2011/09/WF-Admin-Screen-2.jpg" alt="" width="486" height="190" /></p>
<p>Once the user has been given the right responsibility, when they search for any Workflow processes, the previously hard-coded owner field is now an LOV.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/why-isnt-the-workflow-owner-an-lov-in-the-admin-pages/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suppress Workflow Cancellation without using the global setting</title>
		<link>http://www.workflowfaq.com/suppress-workflow-cancellation-without-using-the-global-setting</link>
		<comments>http://www.workflowfaq.com/suppress-workflow-cancellation-without-using-the-global-setting#comments</comments>
		<pubDate>Sun, 04 Sep 2011 09:45:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cancellation]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[suppress]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trigger]]></category>
		<category><![CDATA[war stories]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=587</guid>
		<description><![CDATA[Recently, I got an email asking me about whether there was a way to suppress the cancellation notification on an Item Type basis &#8211; the business had a requirement that for certain processes, the cancellation message needed to be sent, whereas for others, the message needed to be suppressed: I am wondering if it is [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I got an email asking me about whether there was a way to suppress the cancellation notification on an Item Type basis &#8211; the business had a requirement that for certain processes, the cancellation message needed to be sent, whereas for others, the message needed to be suppressed:</p>
<blockquote><p>I am wondering if it is possible to stop the workflow cancellation from being sent to a user when he workflow is cancelled. I realize there is a global profile setting but I can&#8217;t do it globally. It is a custom workflow that I am developing. I was looking into possibly using the #wfm_cancel template and hard code an email address into the peformer but that didn&#8217;t seem to work. Has anyone done this type of thing before or have thoughts on how this might be achieved.</p></blockquote>
<p>Some years back, the global preference didn&#8217;t even exist &#8211; the cancellation message was always sent, much to the consternation of some of my clients.  The way that we dealt with the problem to suppress all the cancellation messages was to create a database trigger which fired when the record in WF_NOTIFICATIONS is updated.</p>
<p>When the global preference was introduced, this trigger became irrelevant and was disabled.  However, if there is a requirement to provide a conditional suppression of the cancellation message, the trigger can be extended to provide this functionality.</p>
<p>Firstly, to remove any need for hard-coding a list of messages which need to have the cancellation message suppressed, define a value set which will contain the notifications which we want to suppress cancellation messages.  The values in the value set can be either the item type internal name (if all the messages in the item type should not have cancellation messages) or the internal names of the item type and the message with a colon delimiter if a specific message should have the cancellation suppressed.</p>
<p>Once the values have been defined in the value set, then create a trigger on WF_NOTIFICATIONS to check whether the message is in the value set.  If it is in the value set, and a response is not required, and the notification is being cancelled, then update the record so that the notification appears to have been sent already by the notification mailer:</p>
<pre class="code">CREATE OR REPLACE TRIGGER XXX_STOP_CANCEL_MSG
BEFORE UPDATE ON WF_NOTIFICATIONS
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW

DECLARE

  dummy PLS_INTEGER;
  v_suppress_ntf          VARCHAR2(10);

  CURSOR c_check_value_set ( cp_vs_name   IN VARCHAR2
                           , cp_type_name IN VARCHAR2
                           , cp_msg_name  IN VARCHAR2 ) IS
    SELECT 'EXISTS'
    FROM   fnd_flex_values_vl       ffvv
    JOIN   fnd_flex_value_sets      ffvs
           ON ( ffvv.flex_value_set_id = ffvs.flex_value_set_id )
    WHERE  ffvs.flex_value_set_name = cp_vs_name
    AND    (    ffvv.flex_value = cp_type_name
            OR  ffvv.flex_value = cp_type_name||':'||cp_msg_name
           )
    AND    NVL(ffvv.enabled_flag,'N') = 'Y'
    AND    SYSDATE BETWEEN NVL(ffvv.start_date_active,SYSDATE - 1)
                       AND NVL(ffvv.end_date_active,SYSDATE + 1);

BEGIN

  IF     :new.status      = 'CANCELED'
     AND :<span>old</span>.status      = 'OPEN'
     AND :new.mail_status = 'MAIL'
     AND :<span>old</span>.mail_status = 'SENT' THEN

    BEGIN
      -- Check whether the notification type is in the Value Set
      OPEN  c_check_value_set ( cp_vs_name   =&gt; 'XXX_SUPPRESS_LIST_VS'
                              , cp_type_name =&gt; :new.message_type
                              , cp_msg_name  =&gt; :new.message_name );
      FETCH c_check_value_set INTO v_suppress_ntf;
      CLOSE c_check_value_set;

      IF v_suppress_ntf = 'EXISTS' THEN
        -- Record is included in the value set, so need to include it
        -- Check that the notification expects a response otherwise
        -- do not cancel it

        SELECT 1
        INTO   dummy
        FROM   DUAL
        WHERE  EXISTS ( SELECT NULL
                        FROM   wf_message_attributes wma
                        WHERE  wma.message_name = :new.message_name
                        AND    wma.message_type = :new.message_type
                        AND    wma.subtype = 'RESPOND' );

        :new.mail_status := 'SENT';
      END IF;

    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        -- Not a response, so no need to cancel it
        NULL;
    END;
  END IF;

END;</pre>
<p>As ever, if you are relying on the code sample here, it is provided without any warranty &#8211; test it fully before deploying to a production environment.</p>
<p><a href="http://www.workflowfaq.com/wp-content/uploads/2011/08/stop_cancellation_trigger.sql">SQL script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/suppress-workflow-cancellation-without-using-the-global-setting/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why do I have to wait for my WAIT?</title>
		<link>http://www.workflowfaq.com/why-do-i-have-to-wait-for-my-wait</link>
		<comments>http://www.workflowfaq.com/why-do-i-have-to-wait-for-my-wait#comments</comments>
		<pubDate>Fri, 15 Jul 2011 10:15:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[background engine]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[process design]]></category>
		<category><![CDATA[wait]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=542</guid>
		<description><![CDATA[One of the common questions I receive relates to why a process does not wait for the right amount of time when using a standard Wait activity &#8211; some times it will wait for the right amount of time, some times a little bit longer, and some times a lot longer (maybe up to an [...]]]></description>
			<content:encoded><![CDATA[<p>One of the common questions I receive relates to why a process does not wait for the right amount of time when using a standard Wait activity &#8211; some times it will wait for the right amount of time, some times a little bit longer, and some times a lot longer (maybe up to an hour!).  Today, I&#8217;ll look at how the Wait activity works and why you get the different times for how long you need to wait before the process continues.</p>
<p>The way that the standard Wait activity works (WF_STANDARD.wait) is that it firstly determines whether this is the first or second time that the activity has been visited.  If it&#8217;s the first time that the activity has been visited by the process, then the different activity attributes are checked and the &#8220;wake up&#8221; time is calculated (i.e. when should the process next do something).  Once the time has been calculated, the procedure sets the result to deferred until that time and ends.  If it&#8217;s the second time that the activity has been visited, then the process sets the result to complete and ends.</p>
<p>So, rather than a &#8220;Wait&#8221; activity, it is actually a &#8220;Defer Until&#8221; activity.  That may not sound like too much of a difference, but there is a fundamental one.  If I suggested that the process will &#8220;wait&#8221;, then the inference is that as soon as the process has waited for a given period of time, then it will continue &#8211; if I was telling a PL/SQL piece of code to wait for a minute then I would call DBMS_LOCK.sleep(60); and as soon as that minute was up, the process will automatically continue.</p>
<p>However, the standard Wait activity doesn&#8217;t actually wait and then continue, it defers processing and the Workflow Engine moves on and processes something else instead.  That&#8217;s because rather than waiting, the thread has been deferred until a certain point in time which corresponds to the wake up time.</p>
<p>Unfortunately, this means that you need to run something to process those deferred activities &#8211; the Background Engine (WF_ENGINE.Background).  One or more Background Engines will need to be scheduled to run at the right frequency to process your deferred activities &#8211; which is why sometimes you wait for the right period of time (your Workflow got to the Wait activity just before the Background Engine ran), a short amount of time (the process got there and waited a little while until the next scheduled run of the Background Engine started), or you had to wait a long time (the Background Engine isn&#8217;t scheduled at the right frequency to meet the process needs).</p>
<p>Determining the number of Background Engines required, and their frequency of scheduling, is a bit of a dark art &#8211; each enterprise will need to monitor that the Background Engines are run at a suitable period but one that isn&#8217;t going to thrash the database into submission.  If, for example, you need the process to wait for 10 seconds before continuing, then you need to schedule a background engine to run every 9 seconds or less, so that the wait cannot get to more than 10 seconds.</p>
<p>Having something wait for a short period of time sounds wonderful in theory (&#8220;Oh, we&#8217;ll just have the process pause for a few seconds while XYZ happens&#8221;) but can have a significant impact on the overall performance of the system.  As soon as I hear someone suggest such a thing (which is fairly often!) then the question I always ask is &#8220;Why?&#8221;  What is so important to the process that you need to wait for 10 seconds, but can&#8217;t wait for 5 minutes?  This is particularly appropriate if you are then sending notifications which require a response &#8211; you want to pause the process for a minute, to get all the data, so you can send it in an email??</p>
<p>If you really (and I do mean <em><strong>really</strong></em>) need a short wait, then you need to consider what the triggering mechanism is &#8211; exactly what are you waiting for?  If that&#8217;s something that can be determined by a change of state somewhere then you are better off including a pause in the process via a Business Event and then have your triggering condition raise the event to show that it has completed the work and the process can restart.  Some developers (more than I care to remember!) have a tendency to include a short wait, then a check to see whether the job has completed, and if not, then loop back and wait again.  If you change the development approach to an event-driven one, then this becomes redundant &#8211; and it means that if something happens to prevent the action taking place, your Workflow isn&#8217;t going to loop and loop and loop, which adds lots more audit and history to the process than you really want.</p>
<p>As a final thought &#8211; I have <span style="text-decoration: underline;"><strong>NEVER</strong></span> used a standard Wait activity, since I started with Workflow development.  There are better ways to do it, and always have been (even before Business Event System was invented).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/why-do-i-have-to-wait-for-my-wait/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can I use a profile to conditionally send a notification via email?</title>
		<link>http://www.workflowfaq.com/can-i-use-a-profile-to-conditionally-send-a-notification-via-email</link>
		<comments>http://www.workflowfaq.com/can-i-use-a-profile-to-conditionally-send-a-notification-via-email#comments</comments>
		<pubDate>Mon, 27 Jun 2011 15:15:00 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[#WF_SECURITY_POLICY]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=553</guid>
		<description><![CDATA[Another one from the inbox &#8211; is it possible to send a notification via email based on a profile option (or some other condition)?  The requirement is that notifications should always appear in the Workflow work list, but for some notifications, there should be an additional copy sent via email.  If the condition is not [...]]]></description>
			<content:encoded><![CDATA[<p>Another one from the inbox &#8211; is it possible to send a notification via email based on a profile option (or some other condition)?  The requirement is that notifications should always appear in the Workflow work list, but for some notifications, there should be an additional copy sent via email.  If the condition is not met, then the notification should only appear in the work list.</p>
<p>&#8212;</p>
<p>Firstly, let&#8217;s look at how notifications are displayed.  Every notification is automatically available in a Workflow worklist &#8211; there is no way to stop that happening.  Additionally, as an &#8220;optional extra&#8221;, you can send the same notification via email, based on the following conditions:</p>
<ul>
<li>The Workflow Mailer must be running</li>
<li>The Workflow Mailer must be configured correctly</li>
<li>The recipient role has an email address configured for it OR (if sending to a role which has multiple users assigned) the individual recipients have an email address configured</li>
<li>Either the global preference is set to receive email (and there is no over-riding preference set by the user) OR the user preference has been set to receive email</li>
</ul>
<p>If any of those are not happening in your system, then the notification isn&#8217;t going to be sent as an email, regardless of what you want to happen.</p>
<p>So, it looks as if the only thing you can do is to either enable or disable the sending of an email.  BUT, there is an alternative which doesn&#8217;t <em><strong>quite</strong></em> meet the requirements, but might do the trick &#8211; it depends on what the business requirements are about whether the notification should be emailed or not.</p>
<p>If the business are concerned about sensitive information being emailed out, then there is an attribute which can be used for the message called <strong>#WF_SECURITY_POLICY</strong> which determines whether the notification should be sent by email or not.  If this is set to <strong>NO_EMAIL</strong> then an email will be generated which tells the user that they need to log into the application to be able to read it.  If that is what the business really want, then this is the way forward &#8211; if not, then adding the attribute may make the situation worse rather than better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/can-i-use-a-profile-to-conditionally-send-a-notification-via-email/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Remove Unnecessary Notes Types From Email Center</title>
		<link>http://www.workflowfaq.com/how-to-remove-unnecessary-notes-types-from-email-center</link>
		<comments>http://www.workflowfaq.com/how-to-remove-unnecessary-notes-types-from-email-center#comments</comments>
		<pubDate>Tue, 01 Feb 2011 16:51:41 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[email center]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Service]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=465</guid>
		<description><![CDATA[Within Oracle Email Center, there is the facility to associate an incoming email to either a new or existing service request.  When you are manually creating the association between the two, the standard Email Center screens (via Email Center Agent Console) allow the user to create new notes against the service request.  By default, however, [...]]]></description>
			<content:encoded><![CDATA[<p>Within Oracle Email  Center, there is the facility to associate an incoming email to either a new or existing service request.  When you are manually creating the association between the two, the standard Email  Center screens (via Email Center Agent Console) allow the user to create new notes against the service request.  By default, however, the list of available notes types probably doesn’t match the ones that you really want the agents to use.</p>
<p>I was working recently with a client on an upgrade from 11.5.9 to Release 12, which also throws up an anomaly &#8211; there are some notes types defined in an AOL lookup where the application ID is set to CRM Foundation.  This means that the list of notes types available now includes some which you cannot query in any other form in the eBusiness Suite.</p>
<p>So, firstly, we need to make those obsolete, incorrect notes types visible to the lookup screen, so that at least we are aware that there are additional notes types that are in the system &#8211; if we can’t find them, we can’t exclude them!</p>
<p>The way that this needs to be done is documented in Metalink note 813677.1.  The note instructs you to delete the notes from the system, but I am always somewhat wary of doing this, in case at some stage they were available and have been used.  Before doing anything with the values, I would recommend that they are backed up into a custom table, just in case we need to revert them at any stage:</p>
<pre class="code">CREATE TABLE xx_obsolete_lookups_backup AS
  SELECT *
  FROM   FND_LOOKUP_VALUES
  WHERE  lookup_type = 'JTF_NOTE_TYPE'
  AND    view_application_id != 0
/</pre>
<p>Instead of removing them completely, run the following SQL which makes them visible but are clearly obsolete:</p>
<pre class="code">UPDATE FND_LOOKUP_VALUES
SET    view_application_id = 0
,      meaning = 'OBSOLETE - '||meaning
WHERE  lookup_type = 'JTF_NOTE_TYPE'
AND    view_application_id != 0
/</pre>
<p>Now, if you navigate to the AOL lookups for the JTF_NOTE_TYPE lookup, the list is now at least complete.  Ideally, you would then just be able to end-date or disable the lookups, but those fields are protected against update.  So, the next step is to create an exclusion list of notes types that we aren’t interested in.</p>
<p>Using the CRM Administrator responsibility, navigate to Task and Escalation Manager &gt; Setup &gt; Object Meta-data and create a new Object Type which will store the list of notes that we aren’t interested in.</p>
<p>For example, I use a name “Unwanted Notes Bin” and code “XX_UNWANTED_NOTES”.  Set the Application to “CRM Foundation” and (this is the important bit), on the Usages tab, ensure that there is a record for object user is “NOTES”, as per the following example:</p>
<p style="text-align: center;"><a href="http://www.workflowfaq.com/wp-content/uploads/2010/10/Define_object_type.jpg"><img class="aligncenter size-full wp-image-468" title="Define new object type" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/Define_object_type.jpg" alt="Define new object type" width="543" height="337" /></a></p>
<p>At this point, depending on how many notes types you want / need to exclude, we hit the really dull part of the configuration &#8211; map the notes you want to exclude to the new object type.  Again using the CRM Administrator responsibility, navigate to Notes Setup &gt; Source and Note Type Mapping.  Create new records for each note type you wish to exclude &#8211; the Source Object should be the name of the object type you have just created, and then include the note type you wish to exclude.  The screenshot below shows my example exclusion list:</p>
<p style="text-align: center;"><a href="http://www.workflowfaq.com/wp-content/uploads/2010/10/Define_note_type_mapping.jpg"><img class="aligncenter size-full wp-image-467" title="Define note type mapping" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/Define_note_type_mapping.jpg" alt="Define note type mapping" width="531" height="356" /></a></p>
<p>If you are doing an upgrade and had to run the SQL at the start of this post, ensure that you add the notes which begin OBSOLETE to the list as well.</p>
<p>Once you have completed the list and saved it, when you next try to add a note to a service request from an email, the list of note types should be what you want to see.  The two screens below show how the list now changes from this:</p>
<p style="text-align: center;"><a href="http://www.workflowfaq.com/wp-content/uploads/2010/10/EMC_long_list_of_notes.jpg"><img class="aligncenter size-full wp-image-469" title="Long list of notes types in Email Center" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/EMC_long_list_of_notes.jpg" alt="Long list of notes types in Email Center" width="266" height="356" /></a></p>
<p>to this:</p>
<p style="text-align: center;"><a href="http://www.workflowfaq.com/wp-content/uploads/2010/10/EMC_short_list_of_notes.jpg"><img class="aligncenter size-full wp-image-466" title="Short list of notes types in Email Center" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/EMC_short_list_of_notes.jpg" alt="Short list of notes types in Email Center" width="191" height="153" /></a></p>
<p>The list of note types available is now governed in two ways.  Firstly, all note types which exist in the custom object type we created here are now excluded.  Secondly, all note types which have been mapped to the Service Request object type will be enabled.  If there are conflicts between the two of these, then the second takes priority over the first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/how-to-remove-unnecessary-notes-types-from-email-center/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Provide Access to HR EITs from CRM Responsibilities</title>
		<link>http://www.workflowfaq.com/how-to-provide-access-to-hr-eits-from-crm-responsibilities</link>
		<comments>http://www.workflowfaq.com/how-to-provide-access-to-hr-eits-from-crm-responsibilities#comments</comments>
		<pubDate>Mon, 24 Jan 2011 13:49:05 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Functional]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[EIT]]></category>
		<category><![CDATA[Extra Information]]></category>
		<category><![CDATA[HR]]></category>
		<category><![CDATA[Menus]]></category>
		<category><![CDATA[Responsibilities]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Service]]></category>

		<guid isPermaLink="false">http://www.workflowfaq.com/?p=451</guid>
		<description><![CDATA[When trying to grant access to HR Extra Information Types to different responsibilities, one of the limitations in HR is that the only responsibilities which appear in the standard form are ones which are related to HR.  For example, querying “Service” in the Information Type Security form (PERWSITS) returns no rows because HR can’t see [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to grant access to HR Extra Information Types to different responsibilities, one of the limitations in HR is that the only responsibilities which appear in the standard form are ones which are related to HR.  For example, querying “Service” in the Information Type Security form (PERWSITS) returns no rows because HR can’t see that responsibility:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-453" title="Service Responsibility is not visible in HR" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/01_Service_not_visible.jpg" alt="Service Responsibility is not visible in HR" width="571" height="418" /></p>
<p>So, if you are working on a system where you need to grant access to HR information types to responsibilities which are not within the HR area (e.g. CRM-based responsibilities), then there is no obvious way to do it.  In this kind of situation, there may well tend to be over-use of responsibilities since an HR and CRM responsibility is now needed to provide the access.</p>
<p>The way to reduce this duplication is to add the seeded HR security menu to the seeded Service menu as follows.  Using the System Administrator responsibility, navigate to Application &gt; Menu and query the menu CSX_CUSTOMER_SUPPORT.  Add a new entry for the submenu UK HRMS SECURITY:</p>
<p style="text-align: center;"><img class="size-full wp-image-454 aligncenter" title="Adding the submenu to the menu for Service" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/02_Adding_submenu.jpg" alt="Adding the submenu to the menu for Service" width="530" height="304" /></p>
<p>Once you have saved the new menu, navigate to the Service responsibility and you will have access to the form to enable you to map access to the information types:</p>
<p style="text-align: center;"><img class="size-full wp-image-455 aligncenter" title="New Sub-Menu is now available to Service Responsibility" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/03_New_Menu_in_Service.jpg" alt="New Sub-Menu is now available to Service Responsibility" width="150" height="205" /></p>
<p>Now when you open the form, you can easily map the required access.  The screenshot below shows adding different information types to the seeded Service responsibility:</p>
<p><img class="size-full wp-image-452 " title="Assigning access to Extra Information Types in Service" src="http://www.workflowfaq.com/wp-content/uploads/2010/10/04_Assign_Access.jpg" alt="Assigning access to Extra Information Types in Service" width="567" height="543" /></p>
<p>This little tip comes courtesy of <a title="Davyd Parry on LinkedIn" href="http://www.linkedin.com/pub/davyd-parry/6/396/754" target="_blank">Davyd Parry</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.workflowfaq.com/how-to-provide-access-to-hr-eits-from-crm-responsibilities/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

