<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by leonard blunt on Medium]]></title>
        <description><![CDATA[Stories by leonard blunt on Medium]]></description>
        <link>https://medium.com/@leonard.blunt?source=rss-4325b249acb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*wb9sUvXihSMCgtjjmYwwDA.jpeg</url>
            <title>Stories by leonard blunt on Medium</title>
            <link>https://medium.com/@leonard.blunt?source=rss-4325b249acb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:44:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@leonard.blunt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using events in Business AutomationWorkflow Part 1]]></title>
            <link>https://medium.com/ibm-cloud-pak-tips-and-good-practices/using-events-in-business-automationworkflow-part-1-76213b17ea33?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/76213b17ea33</guid>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 14:32:59 GMT</pubDate>
            <atom:updated>2022-06-30T14:32:59.463Z</atom:updated>
            <content:encoded><![CDATA[<p>I love event messages and the flexibility they can bring to an IBM Business Automation Workflow. In a few short blogs, I will share some of the use cases and ways I have leveraged events in workflow implementations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2b4Mmd1sTIXvC-nmNkHyA.jpeg" /><figcaption>Photo by Jonas Von Werne: <a href="https://www.pexels.com/photo/multicolored-fireworks-2897462/">https://www.pexels.com/photo/multicolored-fireworks-2897462/</a></figcaption></figure><p>In this blog series, the technical implementation will focus on using Undercover agents using the Asynch queue and UCA services. You can explore the technical variations that vary the delivery modes or the triggering mechanisms, but these are not the focus of this series. Here we will focus more on how I have utilized events and the built-in workflow nodes that support the event-driven interactions.</p><p>Over the series of articles, we will provide simple examples based on actual use cases that will examine various ways to use events. The scenarios we will explore will include</p><ol><li>Starting and Ending processes using events</li><li>Timer Event usage</li><li>Throw and Recieve Error Events</li><li>Sending and receiving message Events</li><li>Utilizing Event gateways</li><li>Event Subprocess</li></ol><p>Most of the events from the designer palette are self-explanatory in their name, so we will not spend much time explaining but dive into the example and scenarios of when we use these events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzeUhuuKH2mGuR_xQ_8G0w.png" /><figcaption>Figure 1 Events Icon definitions</figcaption></figure><p>Events are triggered on a process using a construct called undercover agents (UCA). The UCA passes data to processes through a service or variable. The UCAs will use a service in the example used in this series. The three steps to defining the UCA and Service Flow are;</p><ol><li>Define the Undercover Agent choosing from schedule types of Timer or event.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*3oF8iyCsZMTxs7dtPrnujQ.png" /><figcaption>Figure 2 Defining an Undercover Agent</figcaption></figure><p>2. Define the service details by clicking the &quot;New&quot; or &quot;Select&quot; buttons to select the service. The Service parameters in the service will automatically map to the parameter Mapping.</p><pre><strong>Tip:</strong> Use a wrapper object in the event service flow parameters. This will mean that if the contents of the object changes the event definition remains the same. If many individual parameters are defined in the service flow changes can require a cascade of changes. </pre><pre>When working with events that require correlation keys the service flow would include the correlation key and the wrapper business object.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i6fITsUkECSd33bMXtQoww.png" /><figcaption>Figure 3 Define the Service Details</figcaption></figure><p>3. The service flow pattern is typically a pass-through flow with input and output parameters matching</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-U0Qxr-gbqjZ-tme033J_g.png" /><figcaption>Figure 4 Service Flow with Wrapper BO as input and Output</figcaption></figure><h4>Starting and Ending Processes With Events</h4><p>Starting processes with events is common. It is an excellent way to reduce orphaned processes (1st step started but never progressed); it can also be an easy way to separate phases of a process and decouple processes across business lines.</p><p>Let us start with the simplest of examples. We will complete a starting data collection form from a Client-Side Human Service, and once complete, we will start the process.</p><ol><li>Define the start event. This example uses the event detailed for creating the above event. In this case, we have a StartNewRequstUCA and NewRequestUCAService.</li><li>Now define a process that has a start event with the event mapped to the StartNewRequestUCA. The event variable should be mapped to the process variable and subsequently mapped or passed to process activities. By checking the &quot;Consume Message.&quot;.</li></ol><pre><strong>Tip: </strong>Keep in mind process design best practices by not keeping really large process variables. Process variables should be small business objects or key objects that hold key data to lookup more complex business objects.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMUXdyU9fEjRDgl76pLU3g.png" /><figcaption>Figure 5 Shown here is the Start Event With the UCA</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9sFInCcQdNGG1y7k394_ow.png" /><figcaption>Figur6 Map the Inbound event Variable to Process Variable</figcaption></figure><p>3. From the Client-Side Human Service (CSHS), we see the CSHS definition, and it makes a service call to invoke the event passing the business object data captured in the UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYcDDHvq4EkFnOFCl__-ag.png" /><figcaption>Figure 7 shows the Simple UI and the Service Flow call that maps to the Send Event.</figcaption></figure><pre><strong>Note:</strong> One downside of this 1st step outside the process pattern is that the time spent on this step is not measured. You could consider measuring this and sending the information to be captured as a part of the event data submitted and later captured this as tracing data.</pre><p>Each event scenario has an event Reciever and an Event Sender modeled; in terms of execution, this can mean multiple processes receive and process the event. Another thing that should be clear is that the configuration and execution of events are relatively simple and have low code. As we explore more use cases, the flexibility and ability to decouple work should become clear. It can be a brilliant design choice to break larger processes that include sub-processes using events; it allows for simpler isolated testing and allows different business groups to evolve their sub-process variants independently.</p><p>Let&#39;s now examine ending a process with a send event. From the ending process point of view, there is no impact except that the last action is to send an event. Use cases for End events are to rejoin a waiting process or start a new process. In Figure 8, I show a scenario where a process sends an intermediate event followed by an event gateway that splits into a timer event or a response event. We will discuss the event gateway later for those unfamiliar with it. In this illustration, all you need to understand is that one of the two event options occurs. Once one occurs, the system stops waiting for the other and moves on to the next activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGYoEtrP08wPyqFeNfE59w.png" /><figcaption>Figure 8 Using the End event to return to waiting for the creator process</figcaption></figure><p>In Figure 9, we illustrate the more straightforward starting of a new process when the end process event occurs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5akQOVxJaS6mwbldPsBphQ.png" /><figcaption>Figure 9 The ending first process triggers and starts a new subsequent process.</figcaption></figure><p>In our simplified example, again, no actual coding; the developer creates the UCA, and the UCA Service defines the parameter object to pass and map to the event and data mapping definitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z56fUFVq5k1rVwgqYkd4kg.png" /><figcaption>Figure 10 If the Status is Set to Investigate the Launch Start Investigation event triggers.</figcaption></figure><p>In the example, a user outcome initiates the end event; this could easily result from rules or data analysis outcomes.</p><h4>Timer-based Events</h4><p>Before we launch into intermediate message events and some more complex scenarios, we will discuss timer events. There are two supported mechanisms, the intermediate timer event, modeled as a process step, or the boundary event on an activity, and the Timer-based UCA.</p><p>I have rarely used the intermediate timer event, which causes a delay. One scenario I did observe was when working with out-of-process activities that are known to take a longer time. The timer event injected into the flow delayed starting of the next task allowing for activities outside the process to complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXIiktn3_DZ8E-ZWHuhj-w.png" /><figcaption>Figure 11 Intermediate TIme Event Configuration</figcaption></figure><p>The &quot;Use the process work schedule&quot; checkbox is worth noting that the Timer will pause when outside of scheduled work hours. Figure 12 illustrates this by reflecting that the Timer started right before lunch in the work schedule will pause, changing the effective timer duration to be 4 Hours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eR7d_d-KMUs_FxY1MzTWYg.png" /><figcaption>Figure 12 Use the process work schedule.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAAGJESLTp92WF6TSuYeMA.png" /><figcaption>Figure 13 Boundary Event Timer</figcaption></figure><p>Similar to the intermediate Timer the boundary event timer can link to the activity work schedule and when using timers.</p><pre><strong>Tip: </strong>Using the work schedules is recommended.Good practice is to also standardize the units for timers across your process then use variables and extranlize the values of timers so they can be dynamically modified without having to change code.</pre><p>Additional, in the boundary event, are two properties that need discussion. These properties apply to timer and message boundary events; these are</p><ol><li>Interrupt Activity, when checked and the event occurs, the activity that the event is attached to will be interrupted, and now the process will proceed following the boundary event branch. For example, after three days is not complete, the task is automatically escalated.</li><li>Repeatable, when checked, this means that the event can occur more than once. In the case of a timer, it will repeat based on time, or in the case of message events, multiple messages will be sent/received. For example, if the activity remains incomplete, send an email reminder to the assigned user every day.</li></ol><pre>It should be obvious but an boundary event cannot be simultaneously Interupt and Repeastable.</pre><p>As mentioned above, a timer UCA is another type of timer event. Time-elapsed UCAs set up repeatable schedules, which are very useful in triggering repeated processes that must run at set periods. For example, monthly report processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69cqyT8QS05En4MfGpV5lQ.png" /><figcaption>Figure 14 Time Elapsed Events</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zNQOJMO8JfiC4UDOV_xpwg.png" /><figcaption>Figure 15 Scheduler and Schedule Details of Time Elapsed UCA</figcaption></figure><h4>Conclusion</h4><p>In this first blog, we have established the basics of events and highlighted that they could introduce flexibility and support the decoupling of processes. Also shown is that they are largely low code and configuration driven regarding the triggering and executing of the events within a process. We examined the most straightforward events, the start events, end events, and timer events. We will explore intermediate messages and message boundary events in the next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76213b17ea33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices/using-events-in-business-automationworkflow-part-1-76213b17ea33">Using events in Business AutomationWorkflow Part 1</a> was originally published in <a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices">IBM Cloud Pak Tips and Good practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow Assignments and Priorities — Part 2 Development]]></title>
            <link>https://medium.com/ibm-cloud-pak-tips-and-good-practices/ibm-business-automation-workflow-assignments-and-priorities-part-2-development-a879660baaf7?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a879660baaf7</guid>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 15:31:07 GMT</pubDate>
            <atom:updated>2022-04-01T14:26:24.432Z</atom:updated>
            <content:encoded><![CDATA[<h3>IBM Business Automation Workflow Assignments and Priorities — Part 2 Development</h3><p>This article looks at the practical elements of implementing assignments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*MQFjcHZFfFiplvnl" /><figcaption>Photo by Joey Kyber from Pexels: <a href="https://www.pexels.com/photo/time-lapse-cars-on-fast-motion-134643/">https://www.pexels.com/photo/time-lapse-cars-on-fast-motion-134643/</a></figcaption></figure><h3>Introduction</h3><p>In <a href="https://medium.com/p/9feae75768b0/">part 1</a>, we looked at an analyst&#39;s questions. This article will look at the implementation mechanics and patterns to implement assignments in Business Automation Workflow.</p><h3>Teams</h3><p>Teams are the foundation building block for task assignments. They are a collection of users that determine who will complete tasks when mapped to assignments. Teams are very flexible. They are configurable in two ways, one based on &quot;Users or groups&quot; and two based on &quot;a service.&quot;</p><blockquote>We recommend that when considering the user of “User or Groups” assignment model you should always use groups,assigning users in the process designer is not recommended. Establish groups even when they will be as small as one or two users. Changing users in the team list requires a redeployment of code while groups are managed external to the process.</blockquote><p>The service model for assignments used less than the Users and Groups. Use services when retrieving group data from external sources other than a security registry, for example, building a Team of users from a service call to SAP. Using workflow groups containing security registry groups and or users from an enterprise security registry is the typical way teams are defined. Figure 1 shows a visualization of this structure (Team -&gt; Group -&gt; Group or Users).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUJ3xpC8XwadZ6zib4ijdA.png" /><figcaption>Figure 1 BAW Team to Workflow Group and security groups and users preferred mapping model.</figcaption></figure><pre>Not shown in Figure 1 is the Team to user link option. We strongly recommend not doing this. Not even in development.</pre><p>Take the following steps to prepare a team for the assignment.</p><ul><li>Map the groups from the security registry to the workflow group. If an appropriate group does not exist, work with the security team to create a group that meets the business need.</li><li>Once the group mappings are understood, create the Group in the IBM Business Automation Workflow Admin application, as shown in Figure 2.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXQ00HiHGOogp7qM6FCKbg.png" /><figcaption>Figure 2 Process Admin Group management</figcaption></figure><ol><li>Select Group Management from the Process Admin Application menu.</li><li>Select the New Group, and this will pop a modal view. Enter the group name and the description.</li><li>Consider a naming pattern for your groups at this level.</li><li>Add groups or users from the user registry.</li><li>The Group added, in this case, is the Reviewer.</li></ol><pre>As you add groups within Process admin and from the security registry it can become confusing which groups are registry groups and which groups are process admin groups, we recommend the adoption of a simple naming convention early to distinguish the two. Such as a simple sufix (ie wg) that distinguishes the workflow groups from registry groups.</pre><ul><li>Create the Team in the Process Designer and add the Group (s) to the Team (Figure 3).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k95-GqRGrYobDDViiay-Xw.png" /><figcaption>Figure 3 Team Editor in process designer</figcaption></figure><ol><li>Describe the Team; this can help projects avoid multiple teams trying to complete the same purpose.</li><li>Shows the Group we created earlier added into the groups</li><li>Links to the management team for this Team. The management team is also a team with a group linked in the same fashion.</li></ol><blockquote>This covers the basics of teams, and provides you with what is needed for understanding of the assignments and priorities discussion that follows.</blockquote><blockquote>Final key tips for Teams include:</blockquote><blockquote>Use enterprise Identity and Access Management systems/processes to manage the adding and removing of users in groups, prefer to use groups from the security registry. Doing this means that workflow administrators have no overhead when people join and exit the organisation. Should using groups from an enterprise registry not be possible then make sure that the the workflow administrators complete the addition and removal of users.</blockquote><blockquote>Ensure that Teams are assigned a managing team. Team Managers have permissions to assign and reassign tasks to the managed team (see <a href="https://www.ibm.com/support/knowledgecenter/SS8JB4_20.x/com.ibm.wbpm.wle.widget.doc/topics/cport_gettingstarted_taskperf_new.html">Team Performance Dashboard in the knowledge center</a>)</blockquote><h3>Assignment Fundamentals</h3><p>Set the Task assignment in the assignments tab of the task configuration (Figure 4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvj3HwmjyGGtmZpelQHryg.png" /><figcaption>Figure 4 Assignments Basics</figcaption></figure><ol><li><strong>Assign to:</strong> allows the developer to set the Team to do the work. There are two options in this configuration &quot;Lane&quot; and &quot;Team.&quot; &quot;Lane&quot; means that the Team assigned on the swim lane is the assigned Team.</li><li><strong>User distribution: </strong>defaults to the <em>recommended</em> push model of &quot;None.&quot; The other options are &quot;Last user,&quot; &quot;Round Robin,&quot; and &quot;Load Balanced.&quot;</li><li><strong>Team filter service: </strong>Provides a configuration to set a service to allow the assigned Team to be customized based on process data.</li><li><strong>Experts team: </strong>Define a team of experts at design time.</li></ol><p>A quick look at the &quot;Assign to&quot; shows that Lane or Team-Based assignment options are possible (Figure 5). It has been my experience that Lane based assignment is best; it reinforces the expectation of people viewing the process diagram that the tasks in a specific lane are acted on by the persona of the lane.</p><pre>While that is my preferred model I have seen practices in development groups that do not adhere to this practice. So best to not assume and always verify the assign to method on the task.</pre><pre>Also note that the LastUser in lane assignment will only work with Lane based assignment.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*8jP8WgEb0vIc2T5k2fBtYw.png" /><figcaption>Figure 5 Task &quot;Assign To&quot; options</figcaption></figure><h3>Distributions</h3><p>As discussed in Part 1, there are multiple distribution options. Still, we strongly recommend using <strong>None</strong> to take advantage of a pull model and avoid the pitfalls of push distribution models. Two exceptions are that of Last User and Direct user-selected assignment.</p><h4>Last User In Lane</h4><p>Last User in Lane is a simple no-code scenario assignment model that allows assignment to the process creator or the user who completed the previous Task in a swimlane.</p><ul><li>Request Task 1 is assigned based on the <strong>None</strong> distribution model, meaning whoever claims it first will complete the Task. The user that claims the first Task will automatically be assigned the <em>Notify Request Task 2</em> later in the flow.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5x1ykbmyUNqpLxn_FoMjQ.png" /><figcaption>Figure 6 The second activity is configured for the Last User distribution.</figcaption></figure><ol><li>When the process starts in this case, the user (Sally) claims the task &quot;Request Task 1&quot; when complete, the Task moves to the next step.</li><li>The approver completes their action, and the Task moves to the next step.</li><li>Because the last user distribution model is applied, the same user (Sally) as in step 1 is assigned the task &quot;Notify Request Task 2&quot;.</li></ol><pre>Last user in lane is also used to assign the first activity of a process to the process initiator. When used in this way the task is assigned to the person who started the process.</pre><pre>Last User in lane could become problematic if Sally is not available when the the subsequent task is assigned her. So I would only use this if the intermediary tasks will be short lived. Otherwise allow the task to be assigned at the team level.</pre><p>Another variation is using the Last User in lane assignment to flow from the first Task to claim and open the second Task automatically; in this circumstance, the second Task must be in the same swimlane.</p><h4>Directly Assigned Users</h4><p>Another oft-requested assignment pattern is when businesses require a &quot;user-driven&quot; option to select and assign users. Figure 6. shows this scenario where Task 1 will decide who will be assigned Task 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*sTqvdQKnjMRtjVsSHp5pSQ.png" /><figcaption>Figure 6 The user in the first Task determines the user assigned the second Task</figcaption></figure><p>We will create an example of this scenario where the requestor chooses their approver.</p><p><strong>Step 1: Build a team structure</strong></p><p>When a user selects the assignee for the following task, they can only select members of the Team assigned to the swimlane. By leveraging Team structures, we can</p><ul><li>Ensure that the assigned user is authorized to complete the Task; and</li><li>Allow for Team Manager reassignment if required</li></ul><p>Figure 7 shows the Team structure used in the assignment examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgxnlGVw3f5uDHnDW8nNLw.png" /><figcaption>Figure 7 Example Approvers Team Structure</figcaption></figure><blockquote>Rely on Team structures for determining the users that can be assigned a task. If there are other data influences from different data sources you should ultimately validate the list by ensuring the users exist in the Team structure.</blockquote><p><strong>Step 2: Build A Select List Service</strong></p><p>Here we will build a service to get the users who can be assigned and invoke it from the first user task. In this case, let&#39;s get the users from the <em>Approvers Team.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfEJq5WcpBpt6TIP0KPQdg.png" /><figcaption>Figure 8 Service Flow Definition</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a62a7cdb9d8553a50b69c333b48e0fc/href">https://medium.com/media/0a62a7cdb9d8553a50b69c333b48e0fc/href</a></iframe><pre>By using the tw.local.teamName and tw.local.teamUsers it just makes it clearer the coders expectations, and makes the code easier to  understand compared to only using the non descript ANY types.</pre><ul><li>Should the name list come from an alternative data source such as a database, be sure to embed a code loop that validates the source data against valid team members.</li><li>The code needs to be robust and handle errors or failure to retrieve data, for example, when the lookup failed to get any users and checking that people cannot assign themselves as approvers for their work. Consider what the business needs want to do, such as will there be defaults or error handling.</li></ul><p>Now we will add the select list in a user&#39;s view to assign the user. For this example, we created a simple coach view for the business object RequestData.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THQmbvoqb7PB89OYiR_cZw.png" /><figcaption>Figure 9 Request Data View</figcaption></figure><ol><li>The Request Data business object</li><li>The configuration option sets the name of the Team.</li><li>The requestor is a single select list mapped to the service detailed earlier. Figure 10 shows this configuration.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ua2l8XhrC4D_GvJmUrF7pg.png" /><figcaption>Figure 10 Single Select Configuration</figcaption></figure><p><strong>Step 3 Apply Direct Assignment pattern to Assign User</strong></p><p>We then pass the RequestData business object as an output to the process and use the <strong>Direct Assignment pattern.</strong></p><blockquote>A detailed step by step guide of the Direct assignment pattern can be found <a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-team-filtering-and-direct-assignment-9d6801ff33e1">here</a>.</blockquote><pre>I would recommend that you extend the direct assignment pattern to again validate that the passed in user is indeed a member of the original team. Do not allow security roles to be circumvented by accidentlly assigning someone not in the role.</pre><p>Figure 11 shows the process with the timer and assigned tasks added to the flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NOLp9H7cbRN-btTeKQDnAg.png" /><figcaption>Figure 11 Manual User assignment with Direct Assign pattern</figcaption></figure><p>A variation of this would be where the user could select multiple users; in this case, in such a case, you could leverage a team filter to limit the assignees. As a recommended practice, do not filter teams to one as the task claimant, and the manager cannot easily reassign using the OOTB dashboards.</p><blockquote>Also recommended for scripts on working with Teams is the 3 part blog by Gabriel Dermler, Gerhard Pfau, and Helen O’Shea</blockquote><blockquote><a href="https://www.ibm.com/developerworks/bpm/library/techarticles/1402_dermler1/1402_dermler1.html?ca=drs-">Part 1: Modeling teams with IBM Process Designer</a>, <a href="http://www.ibm.com/developerworks/bpm/library/techarticles/1402_dermler2/1402_dermler2.html?ca=drs-">Part 2: Developing services for dynamic team resolution</a>, <a href="http://www.ibm.com/developerworks/bpm/library/techarticles/1402_dermler3/1402_dermler3.html?ca=drs-">Part 3: Managing teams</a></blockquote><h4>Data Influenced Assignments</h4><p>The next item discussed examines how different ways that process data can influence assignments. Data influenced assignments are a common process design requirement. Commonly data-influenced assignments are completed using a combination of decisions, services, and team filters. When discussing the types of influencers, they are usually data linked to the &quot;Client&quot; persona or based on data points that may be significant in the context of a process; examples might include</p><ul><li>Geographic location includes when specific approvers must process an Account opening in a bank within a branch. Or a commercial lending process must be processed by lending experts from the same geographical region as the lender&#39;s address.</li><li>A relationship status such as tiers of the customer, for example, standard, silver, and gold customers can influence who will be assigned the process.</li><li>Amounts or key data points, like in a purchase order process, the total cost on a purchase order. Or the sum borrowed in a lending process.</li></ul><p>Often more than one such data may need to be considered. Decision tables can be helpful for assignments when multiple data points are required.</p><p>Reflecting on the direct assignment above, if we were to filter the assignment user list based on east and west via an earlier selection, this would modify the list of users that might be assigned. We shall now examine a few ways to address these assignment requirements.</p><ol><li><strong><em>Direct Assignment Variation</em></strong></li></ol><p>Earlier in this article, we discussed a standard assignment model called a direct assignment. In this variation, we consider the user wanting to limit assigned based on east or west users from the defined group structure detailed in figure 7. In this example, the select list becomes the focus of the data filtering, and the assignment model is unchanged. As with the earlier design, we have a select list and have now added two radio buttons that, when selected, trigger a reload of the user&#39;s list by sending the group name parameter into the list service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6LlpUAY8MGw4ki6eRKwPg.png" /><figcaption>Figure 12 Filtered By Just Members of the approvers-west-grp</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/618a7e4128c49ccb489554c34675e672/href">https://medium.com/media/618a7e4128c49ccb489554c34675e672/href</a></iframe><p>We use the On selected event to trigger the reloadServiceItems on the select list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnddbmAgzEv8assPG449Fg.png" /><figcaption>Figure 13 Shows the reload on selected events</figcaption></figure><p><strong><em>2. Assignment Data Filtering Variation</em></strong></p><p>We will continue using the east-west data assignment preference as described above. Still, unlike in a direct assignment model, the data will be passed into a data filter service, creating a dynamic team to return to the team structure.</p><pre>There is a lot of flexibility in what you can do in programmed filters. I would recommend that you consider the following<br>1. Try to ensure that the team integrity of the swim lane is maintainted when the team is filtered<br>2. Beaware that filtered lists of 1 will limit the dashboards and a users abiltiy to use out of the box reassigns<br>3. Discuss with the business if there is a possiblity that filtering will reduce the possible team size 0 this needs to be handled and ultimately must not occure that the filtered team is empty.</pre><p>In this simple scenario, we input data directly into the assignment filter. Again the team name we are deriving from the user input on the request, but in the broader sense of data-based filtering, this might be part of a personas data or part of the collected process data or derived in some other way before the Task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDL7gi03I0uKRv9pzi7ukg.png" /><figcaption>Figure 14 Team filtering driven by data passed to the Team FIlter</figcaption></figure><ol><li>In the create request, we are explicitly allowing the user to choose east or west or no filter; this sets up the teamName as an output</li><li>The teamName is passed into the team filter and will allow for customization of the filtered Team</li><li>Shows the team filter settings and input parameters that will influence the assignment</li><li>In the debug view, we see the user selected the west user&#39;s Group</li><li>The instance Id helps to customize the dynamic team name</li><li>It shows how the team is dynamically named approvers-west-grp5404, matching the data highlighted in steps 4 and 5.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f41a134719aa68a9d6669de09c50534/href">https://medium.com/media/2f41a134719aa68a9d6669de09c50534/href</a></iframe><p>The filter is similar to earlier. The important takeaway is how the data is passed into the filter and used to alter the assigned users.</p><p><strong>3. Assignment Data Routing Variation</strong></p><p>In data point variation, the data drives a decision that influences the team assignments. While this can result in more swimlanes in your process design, it explicitly shows possible outcomes. Based on the decision outcome, the assignment is clear and results in less code, moving us closer to a low code process design. This reduction in code and the explicit nature of the process design make this worthy of consideration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbkKLlQ51uWzDxdU6ZyRYg.png" /><figcaption>Figure 15 Data decisions determine the routing and, ultimately, the assignment.</figcaption></figure><ol><li>The decision service could be a simple decision gateway or an advanced decision service applying business rules or decision tables.</li><li>The assignment is decided based on the data decision, so no further filtering or scripting is needed.</li></ol><p>This simple execution model is easy for businesses analysts to understand. It is very explicit. And while there is an additional swimlane, the user interfaces and coaches can be reused.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNMEkf4-DCwsuzaIY4YyQg.png" /><figcaption>Figure 16 Further highlights A simple decision works</figcaption></figure><p>In this decision case, the user&#39;s selection of east or west drives a decision on which Team will approve the request. But decision gateways can be replaced by advanced decision services, either built-in BAW or externally deployed in a decision manager.IBM</p><h3>Conclusion</h3><p>Assignment customizations and the chosen methods can influence the code understandability of a process. Seek to use the simplest assignment model you can. But know that when needed advanced assignment models are well catered for and possible.</p><p>Next, in this series, we shall look at the Priorities and Work schedule implementations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a879660baaf7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices/ibm-business-automation-workflow-assignments-and-priorities-part-2-development-a879660baaf7">IBM Business Automation Workflow Assignments and Priorities — Part 2 Development</a> was originally published in <a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices">IBM Cloud Pak Tips and Good practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Pak for Integration on OpenShift deployment decisions: Part 1 OpenShift Platform]]></title>
            <link>https://medium.com/ibm-cloud-pak-tips-and-good-practices/cloud-pak-for-integration-on-openshift-deployment-decisions-part-1-openshift-platform-4970192bbf53?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4970192bbf53</guid>
            <category><![CDATA[cp4i]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Fri, 31 Dec 2021 14:59:25 GMT</pubDate>
            <atom:updated>2021-12-31T14:59:25.749Z</atom:updated>
            <content:encoded><![CDATA[<p>Cloud Pak for Integration deployments require planning decisions; this article is the beginning of a series that will focus on production deployment decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDuG1vOIQJ4Np7I1N8tphQ.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@alex-andrews-271121?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Alex Andrews</a> from <a href="https://www.pexels.com/photo/shallow-focus-photography-of-black-and-silver-compasses-on-top-of-map-1203808/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>This series of articles will examine decisions related to the cloud platform, RedHat OpenShift, Cloud Pak for Integration foundations and shared services, and the Cloud Pak component software, including Integration Tracing, API Management, IBM Messaging, IBM Event Streams, Application Connect, High-Speed Data Transfer.</p><blockquote>Note this series of articles will focus on decisions for planning related to deployment of the Cloud Pak for Integration software. Some of this varies depending on the target platforms and the software that is planned. In this first in the series we will deal with the generic decsions when discussing platform and OpenShift delving more deeply in subsequent postings on the variations across platforms. For hands-on commands and sequences of steps product documentation should be referenced. Documentation references here will be for Cloud Pak for Integration 2021.4 and OpenShift 4.8. References can be found at the end.</blockquote><p>Firstly, let&#39;s look at the platform and architecture for deployment on Openshift. <em>Figure 1</em> is an example of an OpenShift deployment on AWS (Variations of this can be found on both AWS and OpenShift sites Reference [1] the quick deployment guide by AWS is one such example).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_E7TWQUXXLTJH3UJRuRWPg.png" /><figcaption>Figure 1 OpenShift on AWS</figcaption></figure><p>Whether the cloud is private, IBM Cloud, Azure, …each cloud platform, will have fundamentally the same conceptual requirements, but their implementation will vary slightly. For example, in the case of RedHat OpenShift Kubernetes Service (ROKS) on IBM cloud, the control plane sits in an IBM-managed zone as illustrated in <em>Figure 2; you will find this to be similar in most managed services situations such as with OpenShift Dedicated Services.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHpiPwmFrxGQUic0PnUYqg.png" /><figcaption>Figure 2 ROKS on IBM</figcaption></figure><p>In considering these figures, there are several decisions that we can begin to discuss. The most obvious of these is the size of the Cluster. You will need to decide the number of nodes that you will need to manage the planned workload. Remember Cloud Pak for Integration production configurations is our focus; as such, we can expect three master nodes for the control plane to confirm a high availability, and as depicted. Deploying OpenShift across multiple zones is essential for continuing service in case of failure. For the Infrastructure, Worker, and Storage planes, the sizing is dependent on planned workloads. Experience has shown that reasonable starting sizes for Cloud Pak for Integration deployments are three infrastructure nodes, five Worker nodes, and three Storage Nodes.</p><blockquote>Note: All comments on sizing are exmplary and must be validated against load and the planned components. The compute nodes available to your cloud of choice can also influence the sizing. IBM Sales, CSM, or Technical Sales teams can help you with sizing.</blockquote><p>But here are some of the top considerations that can influence these node sizing decisions. When it comes to sizing on the cloud, it is worth keeping in mind starting small and scaling fast should always be an option (this can be complicated with private cloud where traditional hardware availability considerations will still influence the availability of sizing).</p><ul><li>Consider the workload that will run on the infrastructure plane. Workloads such as Cluster Logging and Monitoring will increase the size and activity of the workload in the infrastructure plane (see Reference [2] for a more extensive list of &quot;infrastructure&quot; components). When deployed in separate infrastructure nodes, these components will not incur OpenShift subscription costs. A typical starting point for infrastructure configurations is three smaller compute nodes, such as 8 vCPU, 32 GB of RAM, and 120GB of disk. Depending on your deployment preferences, infrastructure nodes can be single or multiple groups. For example, <br>1. Two nodes for Default Router and Registry, <br>2. Two nodes for External Router, and <br>3. Three nodes for Logging and Monitoring.</li><li>When configuring cluster logging, you will need to set the sizing for the Cluster logging, in particular, consideration to the retention policy for application, infrastructure, and audit logging: the replica and resource limits for the elastic search, Kibana, and Fluentd. For Elasticsearch, you will also need an RWO storage class to allocate a storage size for each elastic search replica. (see reference [3]).</li><li>The Monitoring Stack requires planning and consideration of which monitoring components to configure. Planning for the resources of each monitoring component will have resource limit planning and potential storage considerations (see Reference [4]). For example, Prometheus storage has unique concerns, and RedHat documentation recommends for performance reasons the use of local storage(see Reference [5],[6]). New in OpenShift 4.8, there are monitoring capabilities for the user-defined projects. Suppose this monitoring stack is your primary tool for monitoring, alerts, etc. In that case, it seems worth considering the monitoring configuration for the projects established for Cloud Pak for Integration components. (see reference [7]).</li><li>Storage sizing is essential to deployment planning. You will need storage classes of Block(RWO), File (RWX), and Object (RWX). Object storage is used predominantly for backups that are relevant for production setups. But the storage needed depends on the planned components, so take a close look. The Instrustrure nodes will have their storage requirements on top of Cloud Pak for Integration needs. Imagine an example like Cloud Pak for Integration with Cluster Logging and Integration Tracing and API Management components installed. Use the default production template sizing from the Cloud Pak for Integration Platform Navigator. Your sizing may be similar to that shown in figure 3 (This is exemplary for illustrative purposes and based on a specific workload, backup sizing excluded from example). It illustrates the variety of storage needs. For Openshift thinking on storage Optimization, see Reference [8]. For security reasons, you will</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4js4XaNuk9WApskbuYz6A.png" /><figcaption>Figure 3 Sample Storage Sizing</figcaption></figure><ul><li>How many Cloud Pak for Integration components will you run in the Cluster? An increased number of components means a more substantial system requirement which could mean more Worker nodes. Planning your workloads carefully and consulting your architects is recommended.</li></ul><p>So far, we have discussed workload sizing decisions and have mentioned the concept of groups of nodes. It makes sense to take the next step in creating machine sets, consider the machine groupings and plan the labels for workload association to machine sets. Utilizing OpenShift machine sets is an easy way to automate your scaling. Considerations include which groups should auto-scale based on workload distribution and possible storage implications in scaling. For some tips regarding scaling and machine sets, see Reference [9].</p><p>The last item we will discuss for planning the platform&#39;s deployment is security. Application and Role-Based Authentication and authorization are somewhat missing from the above architecture figures. But security is an essential conversation that you must plan and have. Always consider security planning carefully, and it applies to the whole stack network, storage, Cluster, projects, pods, and so on. Initial security decisions are some of the most important. A full identity provider should be used for securing authentication and the groups mapped for authorization. Utilize fine-grained access controls only giving groups access to which they require access. Avoid having many groups or users with Cluster scoped permissions. Some security decisions should be easy such as preferring RHCOS as the default operating system for nodes or encrypting the etcd datastore.</p><pre>&quot;It&#39;s primary goal is to provide a secure operating system platform for running Kubernetes, OpenShift services, and containerized workloads running on an aggragated platform.&quot; <br>     - p.g 37 The OpenShift Security Guide Book (Reference [10])<br></pre><p>Some security decisions will depend on your enterprise policies and agreements with your cloud provider. Some that may need consideration include</p><ul><li>For audit logging, do you require to send your audit to a log storage or Security Information and Event Management (SIEM) system? Do note in the security Guide Book that the cluster logging is logging stack is considered best effort for non-repudiation. Review also the audit policy and retention requirements.</li><li>Will you want full disk encryption enabled?</li><li>What groups should have authorization for managing the Cluster? See page 175, The OpenShift Security Guide Book, Best practices for RBAC management, Reference [10].</li><li>Less common, but do you require an external egress server for managing calls external to the Cluster?</li><li>What timing server will you use for encryption? Review pg 254–255 The OpenShift Security Guide Book, Network Time and Date Encryption, Reference [10].􀂆􀂕􀂘􀂐􀂓􀂌􀀃􀀘􀂊􀂎􀂆􀀃􀂂􀂏􀂅􀀃􀀈􀂂􀂕􀂆􀀃􀂇􀂐􀂓􀀃􀀉􀂏􀂄􀂓􀂚􀂑􀂕􀂊􀂐􀂏</li></ul><blockquote>Note: Later in this series, when discussing the different Cloud Pak for Integration components, we will revisit security specific to the component. Security related to the Platform Navigator will be delt with in the next article.</blockquote><p>With these platform decisions in mind, it is time to look at the Cloud Pak for Integration. In particular, in this article, we will look at the Operator Configuration and the Platform Navigator Operator Installation. Figure 4 provides a reminder of the Cloud Pak for Integration Components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*0LgSYIP-qoGabvth0hzlLQ.png" /><figcaption>Figure 4 Cloud Pak for Integration Components</figcaption></figure><p>The Cloud Pak for Integration Planning documentation covers these topics very well, so we will continue to highlight the decisions required to discuss the options; Considerations include:</p><ol><li>Do I have any specific High availability requirements that will influence deployment or sizing? (See Reference [11])</li><li>When installing the operators, set the scope to All Namespaces, expected for production. But as discussed in Reference [12], there are reasons such as shared non-production Clusters for project scoped installation.</li><li>Do I need to plan which nodes the workload runs? While node selection is possible, it is good to understand the best reasons for node assignment. See Reference [13]. Generally, this is probably not needed for initial workload deployments, and it is best to let OpenShift make it workload assignments where possible. It is a somewhat advanced requirement.</li><li>When installing the platform navigator, consider if more than one replica is needed; this is unlikely. If MQ is to be deployed, you will want to enable the MQ Dashboard, and finally, consider the project name that you will deploy the platform navigator. Use a common prefix for projects where Cloud Pak for Integration components are installed, keeping them grouped in the projects list. For example cp4i, cp4i-tracing, cp4i-api.</li></ol><blockquote>Note: While many of these planning decisions should be acted on if the preferred decision is not clear, additional nodes can be created later, and workloads moved as appropriate. Do not let indecision impede your getting started but as your deployment grows you can always revisit the early deployment decsions and how to manage the workload of the cluster.</blockquote><h4>Summary</h4><p>Setting up a Cloud Pak for Integration on an OpenShift environment can be straightforward. But the reality of production systems remains true; we must plan, think and understand our enterprise&#39;s requirements to ensure reliable platforms to run our business. Figure 5 is a summary of the decisions to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXL_EHoo8-S_oBVR9mkb2A.png" /><figcaption>Figure 5 Summary of decisions to make</figcaption></figure><p>It is worth noting things that must be in the environment have not been addressed here, for example, the need for load balancers. Consider the questions here early where possible they are mostly options but have the potential to impact your deployment.</p><h4><strong>Next in Series</strong></h4><p>We will take a specific look at API Management deployment decisions, including Integration Tracing. Figure 6 illustrates the deployed components in the example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*pfA85zgcajy8fb-vQZiadg.png" /><figcaption>Figure 6 API Management Deployed Components</figcaption></figure><h3>References</h3><p>[1] &quot;IBM Cloud Pak for Integration on the AWS Cloud&quot;<br><a href="https://aws-quickstart.github.io/quickstart-ibm-integration/">https://aws-quickstart.github.io/quickstart-ibm-integration/</a> <br>[2] &quot;OpenShift Container Platform infrastructure components&quot; <a href="https://docs.openshift.com/container-platform/4.8/machine_management/creating-infrastructure-machinesets.html">https://docs.openshift.com/container-platform/4.8/machine_management/creating-infrastructure-machinesets.html</a><br>[3] Installing OpenShift Logging<br><a href="https://docs.openshift.com/container-platform/4.8/logging/cluster-logging-deploying.html#cluster-logging-deploying">https://docs.openshift.com/container-platform/4.8/logging/cluster-logging-deploying.html#cluster-logging-deploying</a><br>[4] Understanding the Monitoring Stack<br><a href="https://docs.openshift.com/container-platform/4.8/monitoring/understanding-the-monitoring-stack.html">https://docs.openshift.com/container-platform/4.8/monitoring/understanding-the-monitoring-stack.html</a><br>[5] Configuring the monitoring stack<br><a href="https://docs.openshift.com/container-platform/4.8/monitoring/configuring-the-monitoring-stack.html#prerequisites">https://docs.openshift.com/container-platform/4.8/monitoring/configuring-the-monitoring-stack.html#prerequisites</a><br>[6]Scaling the Cluster Monitoring Operator<br><a href="https://docs.openshift.com/container-platform/4.8/scalability_and_performance/scaling-cluster-monitoring-operator.html#scaling-cluster-monitoring-operator">https://docs.openshift.com/container-platform/4.8/scalability_and_performance/scaling-cluster-monitoring-operator.html#scaling-cluster-monitoring-operator</a><br>[7] Enabling monitoring for user-defined projects<br><a href="https://docs.openshift.com/container-platform/4.8/monitoring/enabling-monitoring-for-user-defined-projects.html#granting-users-permission-to-monitor-user-defined-projects_enabling-monitoring-for-user-defined-projects">https://docs.openshift.com/container-platform/4.8/monitoring/enabling-monitoring-for-user-defined-projects.html#granting-users-permission-to-monitor-user-defined-projects_enabling-monitoring-for-user-defined-projects</a><br>[8] Optimizing Storage<br><a href="https://docs.openshift.com/container-platform/4.8/scalability_and_performance/optimizing-storage.html">https://docs.openshift.com/container-platform/4.8/scalability_and_performance/optimizing-storage.html</a><br>[9] Recommended Cluster Scaling Practices<br><a href="https://docs.openshift.com/container-platform/4.8/scalability_and_performance/recommended-cluster-scaling-practices.html">https://docs.openshift.com/container-platform/4.8/scalability_and_performance/recommended-cluster-scaling-practices.html</a><br>[10] The OpenShift Security Guide Book<br><a href="https://access.redhat.com/articles/5059881?extIdCarryOver=true&amp;sc_cid=701f2000001Css5AAC">https://access.redhat.com/articles/5059881?extIdCarryOver=true&amp;sc_cid=701f2000001Css5AAC</a><br>[11] High availability considerations<br><a href="https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-high-availability-considerations">https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-high-availability-considerations</a><br>[12] Structuring your deployment<br><a href="https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-structuring-your-deployment">https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-structuring-your-deployment</a><br>[13] Node placement considerations<br><a href="https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-node-placement-considerations">https://www.ibm.com/docs/en/cloud-paks/cp-integration/2021.4?topic=installation-node-placement-considerations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4970192bbf53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices/cloud-pak-for-integration-on-openshift-deployment-decisions-part-1-openshift-platform-4970192bbf53">Cloud Pak for Integration on OpenShift deployment decisions: Part 1 OpenShift Platform</a> was originally published in <a href="https://medium.com/ibm-cloud-pak-tips-and-good-practices">IBM Cloud Pak Tips and Good practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow Assignments and Priorities — Part 1 Analysis]]></title>
            <link>https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-assignments-and-priorities-part-1-analysis-9feae75768b0?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9feae75768b0</guid>
            <category><![CDATA[baw]]></category>
            <category><![CDATA[mpb]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Tue, 21 Jul 2020 09:01:02 GMT</pubDate>
            <atom:updated>2021-11-01T16:50:24.139Z</atom:updated>
            <content:encoded><![CDATA[<h3>IBM Business Automation Workflow Assignments and Priorities — Part 1 Analysis</h3><p>It is essential to capture the complete assignment and prioritization requirements. This article looks at the fundamental analysis and configuration of assignment capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAglQiZhVg3xxyKc63VEZQ.jpeg" /><figcaption>viteethumb © <a href="http://www.123rf.com/">123RF.com</a></figcaption></figure><h3>Introduction</h3><p>When analyzing a business process, it is crucial to explore the details of task assignments. IBM Business Automation Workflow has multiple capabilities related to assignments and priorities. There is more to workflow assignments than just who does the task. In a series of articles, we will explore the features of IBM Business Automation Workflow concerning workflow assignment and prioritization, this first article looks at analysis and asking the right questions to gather the needed information and to set the stage for better user experience.</p><h3>Discovering Detailed Task Assignment Definitions</h3><p>When analyzing a process, we can quickly identify work teams that complete the tasks. As such, it can be easy to forget to discuss other characteristics related to assignments that can influence ‘better’ business outcomes. I have captured here a series of questions that can help a business team to explore additional requirements. Each item helps to discover further the characteristics of the task assignment that will speed delivery and enhance the user interactions with the process.</p><h4>Are all occurrences of a work task given the same priority?</h4><p>We must complete an analysis of what influences task priorities when the answer to the question is no. Prioritized tasks help to guide the users on the tasks they should complete first. New projects often focus heavily on the task assignment and forget to look at the benefits of smarter prioritization. We can easily configure the IBM Process Portal to order tasks based on priority. It has been my experience that priority can also sometimes alter the team or members of a team that should process a request. This work segregation based on priority can be critical to the process model.</p><p>The right task prioritization can improve business outcomes and support the business in completing tasks with a priority-driven focus. Shown in Figure 1 is IBM Business Automation Workflow five(5) priority levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*3plcv1mx7vWYvoUI6wuOjw.png" /><figcaption>Figure 1 Available Priorities</figcaption></figure><p>Class of service, service level agreements, and financial limit values are examples of business data that can modify the priority.</p><blockquote>From this question you want to gather information on what determines the priority and does the priority alter the flow or change the assignment. Don’t forget even if all instances have the same priority you need to find out what baseline the priority for this task will be.</blockquote><blockquote>Look for what are the decisions points related to priority the two common decision points are <br>1. Do we need to determine the priority based on data? Such as with <br> customer loyalty level, or proposed lending amount<br>2. Do we need to make a decision on the team to process the work <br> based in the priority?</blockquote><h4>How long does/should it take to complete the task?</h4><p>The turn-around-time time for the process is the time it takes for tasks to complete; understanding the expected effort is an essential part of process analysis and improvement.</p><pre>The time to complete is an element of the the “Due in” but they are not the same. “Due in” factors in holidays, and work schedules as well as the time to complete.</pre><p>While time to complete seems like a simple question, having productivity measured for some teams can raise anxiety and make them reluctant to set values. Our experience also shows that people will tend to answer this in one of two ways, which are how long the task takes them today or based on a planned <em>new business goal</em>.</p><p>We need to consider which way the user is looking at the time taken in their response. Remember to consider how the automation of steps will impact the time taken to complete a task. Measurement of the process execution times is vital for long term process health. It provides critical insights to help identify bottlenecks and areas for improvement, helping to identify where changes will yield better process efficiency.</p><p>The setting due in can directly impact what managers see in their dashboards. Too short and unrealistic achievable due in will lead to too many tasks overdue. Inaccurate due in can skew calculated values such as at-risk status change. Finding a balance between best-case and worst-case due in time is needed to avoid such skews. Note, work and holiday schedules are not taken into consideration when exact due dates are specified.</p><pre>TaskAtRiskDate = TaskDueDate - AverageTaskCompletionTime AverageTaskCompletionTime = the average time a task of this type takes to complete over all time.</pre><blockquote>From this question you should be able to establish an agreed baseline of the time it takes to complete a task.</blockquote><blockquote>It is recommended that the final times be reviewed and agreed in the presence of the process owner and key business sponsors to validate the target baseline.</blockquote><h4>What should happen if a task does not get completed in time?</h4><p>This question helps explores what actions to take to ensure tasks do not become overdue and what should happen if they do. When tasks exceed their due times, it can be hard to recover. We want to consider here, especially for longer running tasks, the actions that we can take before the due date passes. Sending reminder notifications such as emails to the assignee or team managers, or reassign the activity to a manager are examples of actions teams can take.</p><pre>Most of the listed examples require some implementation as they do not have out-of-the-box configuration options. We shall explore example implementation patterns in the part 2 article.</pre><p>It is relatively common that these actions are not given high priority in the early MVP’s making way for crucial business functions. But we recommend you assess this in the context of the business impact if tasks become past due. It can be vital that specific tasks complete efficiently.</p><blockquote>From this question you should gather information on positive actions that can be taken to promote a task staying on track and completing in time. But also what should happen when a task becomes late.</blockquote><h4>What are the data influences that impact who in the team can process an activity?</h4><p>It is a common requirement with task assignments can be altered to a subset of the team by data influences. A real-world example from banking was when a task created for a branch by a maker role, only specialist checkers for that branch should take action on the checker tasks. Another example from many industries can be where approvers are altered based on monetary value, and only specific individual members of a team can do approvals for higher amounts. <br>Capturing these specializations of the team and the data influences the outcome is a crucial part of assignment analysis. The details captured will later help the developer make choices regarding process modelling, teams, team filtering, rules-based routing, and in all likely hood, a combination of these.</p><blockquote>Capture the sub teams within a team along with the details of the data that determines the sub team assignment.</blockquote><h4>Is there a team of people (Experts) that would usually be consulted on a task if the assigned user could not determine the right action?</h4><p>IBM Business Automation Workflow has a concept of task experts. This team is built upon over time based on users that complete the task. Sometimes an expert team may already exist; this can be captured and defined as a part of the task definition. Setting an expert team on a task helps users to interact with experts through the collaboration features.</p><blockquote>Identify if desirable the experts for tasks and create an experts team. This is most useful for tasks with complex decision making.</blockquote><h4>What are the work times for the assigned team?</h4><p>Typically, teams in a process work the same work times and entitled to the same holidays, set the Work schedule, and holiday schedule at the process level in these cases. Assign schedules at the tasks level when teams in the process have differing work or holiday schedules; for example, let’s take two geographically disbursed teams, a team based in Singapore and a team in the United States. The work times and holidays of these two teams vary based on their country. Another example that can occur is when a Team in a process works non-traditional work hours such as 8 am-6 pm Monday to Thursday, while other teams in the process work 9 am-5 pm Monday-Friday.</p><p>IBM Business Automation Workflow incorporates the work time and non-work time of users when it is calculating the due date for a task. The due in calculation takes into account the scheduled hours and any non-work days that occur. Let us consider the implication of this thru an example, take a task with a due date of 3 days that is submitted at 7 pm on a Friday for a team with a work schedule 9 am-5 pm Monday to Friday work schedule. The task would only become due the following week at 9 am on Thursday.</p><pre>Discuss with teams their work habits and help ensure that the work schedule reflects the behaviours of the team in order to support both the process system and business in setting and meeting the schedules of activities.</pre><blockquote>From this question capture if the team has different work schedules or holidays versus the the expected norm for the process. If there are variations capture, the alternate work and holiday schedules.</blockquote><h4>How should new tasks be distributed amongst the team?</h4><p>Work distribution is often discussed but widely misunderstood. Many work assignments algorithms apply what is known as a push model (examples are round-robin are load-balanced algorithms). The model, as implied in the name, pushes the task to users. All of these traditional push models suffer because</p><ul><li>Users take unexpected leave, and bulk reassignment is needed.</li><li>Users have planned absences, and the workflow engine needs to ensure that tasks are not assigned or waiting for the absent user’s action.</li><li>It presumes all tasks assigned are equivalent and completed with the same level of effort and time, and this is not true.</li></ul><p>The number one reason that users cite for wanting to use push models is the perception of even work distribution across users. However, this should not be the goal. The goal for distribution should be what is the fastest, most efficient way to complete all the tasks currently assigned to the team. The best and recommended general distribution model needs to be a pull model. Pull models acknowledge that users will complete work at different rates and makes sure that free workers can quickly claim the next best task. “None” is the pull distribution model available in IBM Business Automation workflow distribution (Figure 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*DJTj5sc40J55a79YT_x3Uw.png" /><figcaption>Figure 2 None Distribution Model</figcaption></figure><p>Users can see all tasks and their priorities by claiming their next task users move tasks to their queue. Absent users do not claim tasks, so no additional administration is required. In the case of emergency leave, a team manager can use the Team Performance dashboard to check if the user has any tasks and reassign them. Dashboards support the management of workload and tracking work completed by individual users. Understanding and managing underperformers through dashboards allows us to use optimal workload distribution.</p><p>With this noted, there are still cases that require specialized distribution models (in discussing this, I am excluding traditional push methods), and what is the needed distribution must be part of any full analysis. Other requested business distributions can include</p><ul><li>Last User: This is a specialty distribution in IBM Business Automation Workflow whereby task assignment is to the same previous user within a swimlane. Everyday use of this is routing requests back to a process initiator (Figure 3).</li><li>Decision service distribution and Data-driven distribution; this is when a user distribution is selected based on business parameters or rules-based decisions. In the best modeling of this, the service still maps a team with a pull distribution. But this is often implemented as direct distribution to specific users based on the outcomes.</li><li>User-selected. Sometimes business teams will insist that they must select the user to take the next action.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*Wilt9ud-DQ_QUZ8BJA_IlQ.png" /><figcaption>Figure 3 Last User Distribution</figcaption></figure><blockquote>From this question capture any specialty distribution needs. Discourage vigorously the use of generic push models</blockquote><h3>Summary</h3><p>It is vital that the analysis that looks beyond the simple definition of the team to be assigned. The questions (Figure 4) we highlighted here help to fill out a complete picture of the task assignment requirements resulting in better outcomes during implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxeUa7CXfap9Wr53IyXe5Q.png" /><figcaption>Figure 4 Questions Summary</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9feae75768b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-assignments-and-priorities-part-1-analysis-9feae75768b0">IBM Business Automation Workflow Assignments and Priorities — Part 1 Analysis</a> was originally published in <a href="https://medium.com/ibm-business-automation-ap-el">IBM Digital Business Automation Tips and Assets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow Adding a spinning icon for users during long service calls]]></title>
            <link>https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-adding-a-spinning-icon-for-users-during-long-service-calls-c99b33948e16?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c99b33948e16</guid>
            <category><![CDATA[bpm]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[baw]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 09:01:01 GMT</pubDate>
            <atom:updated>2020-04-14T09:01:01.261Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple guide to adding a spinning icon in your UI when making a service call and retrieving data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pypnULQM2WGNmc94GaQD3A.jpeg" /></figure><p><em>Authors: </em><a href="https://medium.com/@leonard.blunt"><em>Leonard Blunt</em></a><em> , </em><a href="https://medium.com/@gregorius.adrian1994"><em>Greg Ekaprana</em></a><em>, </em><a href="https://medium.com/@okkasudaryanto"><em>Okka Sudaryanto</em></a><em>, </em><a href="https://medium.com/@diorellatom"><em>Diorella Mari Tom</em></a></p><h4>Code</h4><p>Code for these examples can be found in the <a href="https://github.com/IBM-BAW-Assets/tips-for-baw-tk">Tips for BAW Toolkit github repository.</a></p><h3>Introduction</h3><p>There are multiple ways this can be quickly achieved to add a spinning icon for when you expect the service in the back-end to take a visibly long time or if for some other reason you want to visually distract the looser while they wait.</p><p>The examples provided here will be very simple drawing attention to three (3) ways we have done this in projects in the past.</p><ul><li>Page level, where the page is locked using a model view</li><li>Inline where the spinner is located in relation to loading data</li><li>Event driven (button/link/icon) where we alter the event driver that triggers the data event.</li></ul><p>Different icons can be used but for our examples here we will use the icon “<em>fa-spinner fa-spin”</em></p><h3>Setting up Table and Service Flow</h3><p>A table and service flow are used in the three examples that follow. We shall provide the details of the configuration for these first. Then elaborate in each example how the service flow events are used to work with the spinning icon.</p><h4>Table View</h4><p>Add the table coach view to the page . This time we will create a variable which is a list of the data object, the table will display productStatus List of ProductStatus (Figure 5).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfPke1gNqFKSgZc6JtDikg.png" /><figcaption>Figure 5 List of Product Status.</figcaption></figure><p>Now when we click “plus “icon to add a new component in the page content click the variable icon on the right of the palette and select the variable from the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*lF5EgOwJjwoKBG_f6w_hFg.png" /><figcaption>Figure 6 Selecting a list variable to add to the view</figcaption></figure><p>A table will be then added to the view of this business object. Edit the table columns to display type and remove columns not needed for the view. By adding the table in this way, the Data will also be bound to the same variable.</p><h4>Service Flow View</h4><p>Now add the service flow that will retrieve the data. Add the service flow coach view to the page your page should be now looking like that shown in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aOs0lP1U8UA9MRIXiqPK1g.png" /><figcaption>Figure 7 Spinner Page example</figcaption></figure><p>Bind the service flow such that it is bound to the same variable this will mean when the service returns the data, it will update the bound variable and this will trigger an update in the table.</p><p>Configure the service flow to invoke the mock service “getProductListStatus” and set to auto-run so it is invoked when the page is loaded (Figure 8)</p><pre>Note: &quot;getProductListStatus&quot; is a mock service that returns generated data. For these examples we have inserted java.lang.Thread.sleep(10000); into the service flow. This helps to delay the response and illustrate the spinner.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*be4togpiuO1k6kfi8f1Rxg.png" /><figcaption>Figure 8 Get Product List will Auto run on load</figcaption></figure><pre>TIP: It is important to put other UI components before the service flow as later we will use the events of the service flow to trigger states of the spinning icon. If the service flow sits before the referenced UI components you will likely have view not found errors as the events on the service call will trigger while the UI is still loading, this is a result of using the &quot;Auto-run&quot; this can be controlled if using other event mechanisms.</pre><h3>Example 1: Spinner page level</h3><p>In this example we will illustrate the steps to use a modal that will lock a page from inputs while the data is loaded.</p><p>There are 4 key components used in this simple example</p><ol><li>A custom Spinner coach view (SpinnerCV) that displays the spinning icon;</li><li>A Modal Section which embeds SpinnerCV and is shown while data is being loaded and hidden otherwise;</li><li>A data table to show the returned data results.</li><li>A service call that retrieves the data from the back-end, using its events to trigger the show and hide of the modal; and</li></ol><h4>The Spinner View</h4><p>The spinner view is a simple coach view made for this example; it includes a timer script to show the user how long they have waited. The icon will spin automatically when made visible, but the timer needs to be started and stopped each time the modal is opened. There is a start and stop script in the coach view and the sample code is uploaded to <a href="https://github.com/IBM-BAW-Assets/tips-for-baw-tk/blob/master/spinning-icon/start-stop-timer.js">github</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*HUmc5BeEwI9g1Rfoa78TOA.png" /><figcaption>Figure 1 SpinnerCV combines spinner icon with output text and timer</figcaption></figure><pre>The icon name used is <em>fa-spinner fa-spin</em></pre><h4>Modal Section</h4><p>The modal view uses the out-of-the-box view for displaying modal view. The show and hide events on the modal are used to trigger the timer and visibility on the embedded coach view. To create click the plus icon on the page editor select Modal Section from the UI palette (Figure 2), inside the sections content area repeat and add the Spinner CV (Figure 3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEVvwVu5P-vbmJ6LSvh83w.png" /><figcaption>Figure 2 Add a Modal Section</figcaption></figure><p>Then add the Spinner CV to the inner content of the Modal Section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1GY0LfjTwanz6cZYhN3aQ.png" /><figcaption>Figure 3 SpinnerCV as with all CV can be found in the Add palette</figcaption></figure><p>Once this is configured alter the show and hide events to call the functions on the embedded coach view when the modals show and hide events occur, this is illustrated in Figure 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLcAU4OuIBqrvyVs7ZPlAQ.png" /><figcaption>Figure 4 Call the set visible start timer and stop timer on the SpinnerCV</figcaption></figure><pre>SpinnerCV1 is the control id given to SpinnerCV when added.</pre><h4>Update the Service Flow Events</h4><p>The last step before we run is to set the events on the service call to trigger the show and hide modal when the service is invoked and completed respectively (Figure 9).</p><pre>SpinnerModal is the name that was set in the Modal Coach view Control ID.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DlgenUvQQpSfjKZ21fFKg.png" /><figcaption>Figure 9 Get Product List Events set to show and hide the modal view</figcaption></figure><h4>Run Example 1</h4><p>With all the pieces in place the example can now be run, and the user will see a spinning icon with the page locked because of the modal mode until the data is loaded. An example of this output is shown in Figure 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gszB-FivsgMnHX3nWyVr9Q.png" /><figcaption>Figure 10 data loading with timer and spinning icon</figcaption></figure><p>The completed example can be run from the Tips for BAW toolkit. Open “Spinner Page Example” and run.</p><h3>Example 2: Inline Spinner</h3><p>This model takes a less intrusive approach by not locking the entire page but works to convey to the user that some action is still underway. The table and service flow invocations are the same as in Example 1. But the spinner is simplified here to be the icon and output text and a horizontal section see Figure 11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzf4VR9v4eSidCfATdZFQg.png" /><figcaption>Figure 11 Simple Horizontal section proceeding table</figcaption></figure><h4>Update the Service Flow Events</h4><p>In example one the Service call events manipulated the show and hide for the modal, in this example the events do the same but now it is the horizontal section that is being manipulated as shown in Figure 12.</p><pre>spinnerLayout is the Control ID given the horizontal section that precedes the table. The collapse parameter in the setVisible for when the view is not visible is set true, so the white space is release to the visible components.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkAB8q2O1tCaLU1km011qQ.png" /><figcaption>Figure 12 Service Flow events controls visibility of the Spinner horizontal section</figcaption></figure><h4>Run Example 2</h4><p>With all the pieces in place the example can be run, and the user will see a spinning icon above the table while the date loads Figure 13 note the whole page is not locked and the user could still take action or trigger events if appropriate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5IU8DoerDbBTvyoDebjYQ.png" /><figcaption>Figure 13 Shows the Data loading</figcaption></figure><p>When the data is loaded the icon visibility is set to false and the user sees the loaded data only shown in Figure 14. The space used for the section is collapsed as highlighted earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3Nwkr1fqIeljOmtkRlzdQ.png" /><figcaption>Figure 14 Data Loaded</figcaption></figure><p>The completed example can be run from the Tips for BAW toolkit. Open “Spinner Inline Example” and run.</p><h3>Example 3: Event Driven Spinner</h3><p>The event driven spinner is a common request to this approach also where some state of the UI component that triggers the event occurs. This can commonly be requested for links, buttons, icons etc. Again, the service flow and the table from example 1 remain unchanged. In this example we will change the Icon on the refresh button to spin and disable the button while the data is being loaded.</p><p>When the “Refresh” Button is clicked it will call the execute on the service flow</p><pre>ServiceCall1 is the given Control ID on the service flow coach view.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6HcOFw_vuRAc4O046gx94Q.png" /><figcaption>Figure 15 Execute the Service when refresh is invoked</figcaption></figure><h4>Update the Service Flow Events</h4><p>As with the earlier examples the action will take place on the Service Call events, where now we manipulate the Refresh button characteristics. Where the refresh button icon is changed to the spinner icon and the button is disabled during the invoke and it is set to the refresh icon and set enabled when the call is finished (Figure 16)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z8xypHKjsG7H-q-0sZGx-g.png" /><figcaption>Figure 16 Button characteristics modified based on service call events</figcaption></figure><h4>Run Example 3</h4><p>With all these setting in place the example can be run, and the user will see a spinning icon on the refresh button when they click refresh in Figure 17.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOV--DU0bj07siqUYxWMYA.png" /><figcaption>Figure 17 Spinning Icon on Refresh Button when Data is loading</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c99b33948e16" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-adding-a-spinning-icon-for-users-during-long-service-calls-c99b33948e16">IBM Business Automation Workflow Adding a spinning icon for users during long service calls</a> was originally published in <a href="https://medium.com/ibm-business-automation-ap-el">IBM Digital Business Automation Tips and Assets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow Adding Automatic Data Refresh to A View]]></title>
            <link>https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-adding-automatic-data-refresh-to-a-view-3c7fc4e58ec8?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7fc4e58ec8</guid>
            <category><![CDATA[baw]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 09:01:00 GMT</pubDate>
            <atom:updated>2020-03-31T09:01:00.932Z</atom:updated>
            <content:encoded><![CDATA[<p>A quick guide to adding a auto-refresh script in your coach view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjpclkvFt8M9dBCoArXyJw.jpeg" /></figure><p><em>Authors: </em><a href="https://medium.com/@leonard.blunt"><em>Leonard Blunt</em></a><em> , </em><a href="https://medium.com/@gregorius.adrian1994"><em>Greg Ekaprana</em></a><em>, </em><a href="https://medium.com/@okkasudaryanto"><em>Okka Sudaryanto</em></a><em>, </em><a href="https://medium.com/@diorellatom"><em>Diorella Mari Tom</em></a></p><h4>Code Repository</h4><p>Deferred Section Example is in the <a href="https://github.com/IBM-BAW-Assets/tips-for-baw-tk">Tips for BAW Toolkit in github</a>.</p><h3><strong>Introduction</strong></h3><p>We have found that there are times when a business group or unit may have a view that they want to automatically refresh, the requirement is common enough and as such we will share the basic scripts to quickly accomplish this.</p><p>In this example we will focus on refreshing of data for a section of view. Using a simplified example of a pattern we called a <em>preset filter </em>which was implemented in a recent project.</p><p>So, let’s start by setting a business context on what a <em>preset filter</em> was and how they were applied. In the scenario we were working with a number of steps in the workflow that were event driven with activities happening as swivel chair outside of the main process flow, users who conducted the external activities would update a data into a dashboard which would sometimes trigger process events. With this interactive dashboard established the preset filter was a way for the user to infer a business state and quickly limit the records in the dashboard to the filtered business state.</p><pre>The filter was often inferred my multiple data fields and was part of a large dataset which is why standard table capabilities were not used to meet the requirement. </pre><p>For example, states such as “Wait-Document-From-Client”, ‘“Pending-Internal-Document-Signing”. The business needed the filter links to show the user the number of records in that state much like an email inbox or badges on a mobile app. This requirement is what actually led to the need for the refresh to periodically update the counts on these filters as the dashboard pages was the main working area for these workers and they rarely navigated to other views.</p><pre>We will use this scenario to setup and demonstrate the auto refresh. The business data and service flows will be significantly simplified to retain focus on the refresh, which of course can be used for a great many other reasons.</pre><h3>Example Adding Auto-Refresh to The Preset Filter</h3><p>We have developed a simple data UI showing records in a table with a filter selectable above the table.</p><p><em>The business scenario we mocked up here was a list of products and their current inventory count and status. You can imagine that their status gets set based on rules implemented in the back end based on historic consumption rates. We have set it up to work with four basic status, In Stock, Reordered, Out of Stock, and At Risk. In this simple scenario let’s assume that when reordered the user has an out of system activity to check delivery date if not received 1 week after ordering, and an out of system activity to Reorder out of Stock, or At Risk items.</em></p><pre>Please take note to highlight the auto refresh the service flow <em>&quot;getProductListStatus&quot; </em>was set up to always return a different result set altering the count of records meeting the filtering criteria.</pre><p>We commence with the baseline of the simple data table and filter as described already configured and working. This is illustrated in Figure 1 “Auto Refresh Example” Dashboard. In this view, we see the table data the filters being shown which tell us how many products are ready for reorder and how many need their delivery date checked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgJK3f8YXQaof_a4rM2viw.png" /><figcaption>Figure 1 Table and Preset Filter without Auto Refresh.</figcaption></figure><p>As discussed, the user scenario is that this dashboard is the workspace for the team assigned, so as product orders are processed the number of items to reorder and items to be checked for delivery will change over the day. To assist the user, we will add an auto-refresh to the view.</p><pre>When running the toolkit demonstration, a version of the coach view exists that does not have the refresh yet applied. You can switch the CSHS to this view if you want to run and execute without the refresh applied. Use StockDashboard coach view.</pre><h4>Determine the features of the Refresh</h4><p>When adding refresh to a UI section or page we typically include three main features</p><ol><li>Ability to disable Auto-Refresh (typically defaults enabled)</li><li>Ability to change the refresh interval</li><li>Ability to manually refresh and not wait for the auto refresh</li></ol><p>For the purposes of this example we will implement all three of the above.</p><p>This is done by opening the coach view. The auto refresh functions are for the filter counters as this is the case, we will place the refresh within this section of the view.</p><pre>This view is inside a deferred section that has visibility set to None. When editing the view set the visibility to hidden. And change back when completed.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjmKIeRbD2BtE_yFBZrNfg.png" /><figcaption>Figure 2 The UI components of the Auto Refresh</figcaption></figure><p>If looking to use the scripts that will follow the UI components should be given the following control ids</p><ul><li>CheckBox = autorefreshCheckbox</li><li>Interval Label = autorefreshIntLabel</li><li>Integer = autorefreshInt</li><li>Icon = autorefreshIcon</li></ul><p>Having added the UI components, we can now add the java script functions to support the auto refresh in the inline JavaScript. The auto refresh scripts have been uploaded to the git repository <a href="https://github.com/IBM-BAW-Assets/tips-for-baw-tk/blob/master/auto-refresh/autorefresh.js">here</a>.</p><pre>This code is also a good candidate to extract to a script library, except for the refresh function which will need to be unique for each use.</pre><p>There are 5 functions that have perform the auto refresh and some global variables to keep track of the current state within the view.</p><h4>initAutoRefresh() Function</h4><p>The initAutoRefresh function sets the default check box value and the default interval for the automatic refresh. In our example, refresh sits inside a deferred section. This means that the init must only be called once that section is loaded. As a result, the showHideFilters (Figure 5) adds a call to the initAutoRefreshFunction. But we only want the function to init one time and the showHideFilters can be invoked many times as such Line 14 ensures init functions only execute once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gk73tLiWfGY5S3QsbSs27A.png" /><figcaption>Figure 3 Auto refresh Global Variables</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*SZPTw5BgwsjOxXAE9N1RjQ.png" /><figcaption>Figure 4 initAutoRefresh function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jP6xG39k_9R8r_J-wqaFxg.png" /><figcaption>Figure 5 showHideFitlers Function</figcaption></figure><h4>setAutoRefresh() Function</h4><p>The setAutoRefresh function sets the values for the interval and if the auto refresh is enabled calls the <em>startAutoRefresh</em> function.</p><ul><li>The function checks that the minimum interval that can be set is 1 minute.</li><li>In the case that it is disabled the UI components for the interval and the manual refresh are hidden.</li><li>When this function is called if auto refresh was already started the currently running script is stopped in preparation for the changed configurations. The Interval id returned when the auto refresh initiated must be used as a reference key to stop the initial configuration.</li><li>Once finalized if the auto refresh was not turned off then the startAutoRefresh function will be called.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wougrRIMafpWxW0adrPnkw.png" /><figcaption>Figure 6 setAutoRefresh function</figcaption></figure><h4>startAutoRefresh() Function</h4><p>The start auto refresh sets the callback function and the interval using the JavaScript setInterval function, sets the active tracking variable to true and returns the tracking id.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2Rle3M8rrRAaP2a83VZMMQ.png" /><figcaption>Figure 7 startAutoRefresh Function</figcaption></figure><h4>stopAutoRefresh Function</h4><p>Clears the interval using the id returned from the stop and sets the active tracking variable to false.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*J-uYuTbe9DrqBDUaW_hlVA.png" /><figcaption>Figure 8 stopAutoRefresh Function</figcaption></figure><h4>refresh Function</h4><p>This function is key to executing the refresh. Each time this is setup what you want to do in the refresh will change. But by using this wrapper function the startAutoRefresh does not need to be changed all the time to alter the callback function. In our example in the refresh function we call the <em>getCounts</em> functions which invokes the service call and triggers the refresh of the filter information displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*tDlDmV9wXrrTiJvRI6epww.png" /><figcaption>Figure 9 refresh Function</figcaption></figure><h4>Final Steps</h4><p>With the functions in place the final sets is to add calls to the functions from the auto refresh UI components</p><ul><li>Checkbox — onChange event</li><li>Integer — onChange event</li></ul><pre>view.setAutoRefresh();</pre><ul><li>Icon — onClick Event</li></ul><pre>view.refresh();</pre><h3>Summary</h3><p>In summary with any view that may need some automatic refresh you can quickly setup the capability and utilize these reusable scripts. The toolkit includes the completed working code as well as the incomplete coach view that you can copy to quickly recreate this work here. Shown in Figure 10 is the UI with the logging enabled in the developer console showing the calls to alter the timing and then the calls to get the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cdN2Dkwtti8Yo8FtuXiBJw.png" /><figcaption>Figure 10 Filter Counts Auto-refreshed</figcaption></figure><ol><li>Shows the logging in the init stage followed by the result from the initial service call that is part of the data load</li><li>Shows the change or refresh interval to 1 min. Then the subsequent refresh which retrieved the new result.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7fc4e58ec8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-adding-automatic-data-refresh-to-a-view-3c7fc4e58ec8">IBM Business Automation Workflow Adding Automatic Data Refresh to A View</a> was originally published in <a href="https://medium.com/ibm-business-automation-ap-el">IBM Digital Business Automation Tips and Assets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow Filtering and Sorting Coach View for Server Side Paging Section…]]></title>
            <link>https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-filtering-and-sorting-coach-view-for-server-side-paging-section-8b163f78976b?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b163f78976b</guid>
            <category><![CDATA[baw]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[assets]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 09:01:01 GMT</pubDate>
            <atom:updated>2020-03-24T09:01:01.093Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>IBM Business Automation Workflow Filtering and Sorting Coach View for Server Side Paging Section Asset</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*2UOQrXpfTkN245oi3bZr0w.jpeg" /><figcaption>maximplotnikov © <a href="http://www.123rf.com/">123RF.com</a></figcaption></figure><p><a href="https://medium.com/@leonard.blunt">Leonard Blunt</a> , <a href="https://medium.com/@gregorius.adrian1994">Greg Ekaprana</a>, <a href="https://medium.com/@okkasudaryanto">Okka Sudaryanto</a>, <a href="https://medium.com/@diorellatom">Diorella Mari Tom</a></p><h3>Code Repository</h3><p><a href="https://github.com/IBM-BAW-Assets/paging-section-tk">Paging Section Toolkit Git Repository</a></p><h3>Introduction</h3><p>In a separate posting we detailed the use of a <a href="https://medium.com/ibm-business-automation-workflow-server-side-paging-section-asset-aac32ff324f3">Paging Section coach view</a> that supports limiting the data retrieved to a table and manages the data paging on the server side. Once we had this capability business users still needed to be able to sort and filter data. As the table view was only a subset of the entire data this meant we needed a way to capture the filter/sort data and process that on the server side. The basic initial business request was to be able to filter the dataset using a filter that only included actual data in the full dataset, for example if the table had a column of cities the business only wanted cities in the filter that existed in the table not a filter of all possible cities. While this was the origin, the requirement evolved to incorporate a number of different ways the business wanted to filter the dataset. Each way final requirement is detailed in the section titled “The Business Requirements”.</p><p>Initially some attempts were made to do this column by column but we quickly realized to determine the filter set for filters that are not later used in a view was highly inefficient. This led to the design and approach of the current Filtering and Sorting Coach View (CV) that provides user interaction that can be used in conjunction with the Paging Section to filter and sort the data on the server side. This article will provide a step by step example of using the filtering and sorting CV in conjunction with a Paging Section CV. For a detailed introduction to the Paging section see <a href="https://medium.com/ibm-business-automation-workflow-tips-tricks-and/ibm-business-automation-workflow-server-side-paging-section-asset-aac32ff324f3">“IBM Business Automation Workflow Server Side Paging Section Asset”</a>.</p><pre>IMPORTANT: The filter and sort coach view captures what the user wants filtered or sorted. The filter coach view does not execute the services flow to limit the data displayed. When a filter or sort selection is made a changed event is triggered passing the filter data and sort config business object lists as parameters on the event. The developer should then update the filter and sort variables and invoke the paging section coach view <em>first()</em> or <em>init()</em> functions.</pre><p>We will use the following sections to capture the details of the example:</p><p>1. <a href="https://medium.com/p/8b163f78976b#bf63">The Business Requirements</a></p><p>2. <a href="https://medium.com/p/8b163f78976b#2859">Setup and Configuration</a></p><p>3. <a href="https://medium.com/p/8b163f78976b#6a4d">Filter Changed Event and Paging Section</a></p><p>4. <a href="https://medium.com/p/8b163f78976b#0788">Server Side Query modifications with Filtering and Sorting</a></p><p>5. <a href="https://medium.com/p/8b163f78976b#3b04">Advanced configuration</a></p><h3>The Business Requirements</h3><p>The original requirement was to have a capability for a user to filter the dataset in a table using a list of values, but as different data types and columns were examined the filter types evolved into those summarised in the series user stories below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dvb6rQgN1glbC5v3SoViOQ.jpeg" /><figcaption>Table 1: Business Requirement Summary</figcaption></figure><h3>Setup and Configuration</h3><p>At this point we will introduce the components of the implementation and break down what you need to know in order to setup and use the coach view (code examples usage, and database DDL scripts can found here). Figure 1 shows the key components of the view and the numbered items will be discussed in more detailing what a developer needs to know to configure and use the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*fz1OKGL79gNrmE_-9LSI4w.png" /><figcaption>Figure 1: Filter Sort Coach View</figcaption></figure><ol><li>Configuration</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5uNZgUnEaN5IMCas2nghA.png" /><figcaption>Figure 2: TableFilterCV Configuration Options</figcaption></figure><p>2.Binding — <em>FilterDataSet</em></p><p>The developer does not need to know a lot about the bound business object to use by the coach view. The high-level bound instance must be initialized. Create a local variable and initialize it then bind it to the view</p><pre>tw.local.filterDataSet = {};</pre><p>3. Filter Config Service Call</p><p>When the coach view is initialized it invokes the Filter Config service call, the “View Name” specified in the configuration on the coach view is the key for the configuration in the database. Through the database configuration the developer is able to manipulate the columns that can be filtered and specify the filter type of each column. The filter type dictates the user interaction model (This is further elaborated as we proceed in this posting). Before elaborating on this further we will step back and examine how the filter is used this understanding should make it easier to understand the filter configuration to this end shown below is a contrived dataset to illustrate a simple application dataset and a mock-up of how this may be displayed.</p><pre>TIP: Remember that ultimately the filter and paging section where built for working with large dataset when it is not reasonable to pull all data to the client side. The filter ultimately supports refining the server-side query by helping to identify appropriate data limiters. It is rarely necessary and not recommended to filter and sort based on every column.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*v-SM5UjC9pOECua6P_JmMA.png" /><figcaption>Figure 3: Simple Application Example Data</figcaption></figure><p>Through configuration the columns to be filtered are set. Figure 4 shows a configuration of sample data using the example data set out in Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*VYY4Im7jJ8gxlnYfBGJ-Yg.png" /><figcaption>Figure 4: Configured Filter Example</figcaption></figure><p>Each of these filters is configured as a row in the SS_FILTER_CONFIG table, the filter config table determines the filters that are shown to a user based on the “View Name” from the coach view configuration.</p><p>The definition of filter config table is shown in Figure 5.</p><pre>The DDL for the table setup for the filter and sort is available in filter-config folder of the <a href="https://github.com/IBM-BAW-Assets/paging-section-tk">“paging-section-tk” git repository</a>. </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*Popcd4Vihnx3uOmVbgr7qg.png" /><figcaption>Figure 5: SS_FILTER_CONFIG TABLE</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0h-SuvwAKkvQ0kRveY6zA.png" /><figcaption>Table 2: SS_FILTER_CONFIG Column Description</figcaption></figure><h4>Supported Filter Types</h4><p>The filter coach view supports two categories of filter types, the first provides ways for the user to provide direct inputs to set the filter data and the second category allows the user to select the filter data from lists of existing data from a dataset. The lists are returned from SQL queries that are configured and run when the filter is selected. The queries are preset in the FILTER_QRY column. The supported filter types that may be entered into Filter config TYPE column are defined thus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJ4NFDNW5lgU5W2ZycDuyQ.png" /><figcaption>Table 3: Supported Filter Type summary</figcaption></figure><p>The FILTER_QRY column used by the category 2 filter types must map to selected values to “name” for <em>int</em>, <em>dec</em>, and <em>string</em> and “name” and “value” for <em>nvp</em> and <em>intValue</em> where “name” maps to the data and “value” maps to what is displayed to the user.</p><pre>For example, “SELECT X as name …” and “SELECT X as name, Y as value …”.</pre><h4>Filter Configuration Example</h4><p>Using the table defined from Figure 3: Simple Application Example Data” we created a filter configuration example as shown in Figure 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*Rib4izs2c8eOL5ILzcVmJA.png" /><figcaption>Figure 6: Filter Config Example</figcaption></figure><p>To illustrate different configuration types the four highlighted configurations from Figure 6 will be examined in some detail</p><p>Filter Config Example 1: Receipt ID is configured as type “batch”, this provides a text based input for the output FilterData the input data is mapped to the stringList and the datatype is set to string</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILQxEE2ixvgf9jpPJkQe6Q.png" /><figcaption>Figure 7: Filter Config Example 1</figcaption></figure><pre>REMEMBER: The filter does not apply the filtering. And consequently, with batch type inputs there is no validation if the values input exists. Values that do not exist will not impact the filtering but that means users need to be conscious of correctness of values entered.</pre><ul><li>Filter Config Example 2: Purchase Date is configured as “dateR” (date range), this provides a data entry for from and to date input. The output is mapped to the fromDate and toDate while the datatype is set to dateR</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RuepceORSv2SFAFGZdvWSQ.png" /><figcaption>Figure 8: Filter Config Example 2</figcaption></figure><ul><li>Filter Config Example 3: City of Purchase is configured as “nvp” (name value pair), this is a category 2 type the coach view retrieves the configuration and executes the query that is stored in the FILTER_QRY column. and the options are mapped into a list and the user is provided a pick list. The pick list data is set by the data returned by the FILTER_QRY, the selected data items are mapped to stringList and the data type is string.</li></ul><pre>SELECT CITY_NM AS value, CD AS name FROM &lt;schema_name&gt;.EG_CITY_CODE<br>WHERE CD IN (SELECT CITY_CD FROM &lt;schema_name&gt;.EG_PRODUCT_PURCHASE GROUP BY CITY_CD</pre><p>The filter framework supports a string substitution for the schema name that can be replaced as shown in the example by <em>&lt;schema_name&gt; </em>this value will be replaced at runtime by the schema ENVIRONMENT variable <em>tw.env.DSN_NEWSCHEMA_NAME.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWvWndsZd7DRRQ0LCDywqg.png" /><figcaption>Figure 9: Filter Config Example 3</figcaption></figure><p>There are architectural considerations that is worthwhile commenting on at this point. There is an inherent cost to providing such filtering, so developers and users need to take this into consideration. As a result, we recommend that filtering is only done on columns that will help a user simplify the large dataset quickly this will help avoid over indexing or taxing the database with complex and expensive queries. Plan for and include additional indexing on columns that are filtered, but as most database administrators would tell you there is also a cost to this and be careful not to overuse these database features.</p><p>There is also an argument on whether it is really valuable to filter a dataset such as cities to only be those in the table, a different approach to the query shown above would be to get all the cities in the city list, and allow the server side query to return no values for cities not in the dataset. In the case of a full list the data result could be cached and not have to check the database each time for the current values in the dataset. This comes down to efficiency versus usability for the application design and depends largely on the dataset.</p><p>When planning filters for the data the impact on performance and frequency of queries to the database should be considered.</p><pre>In the case of that, the dataset is likely to include all possible values the filter config could be simplified to the full pick list data and the result cached to reduce calls to the database. </pre><pre>In the example above, the CACHE_QRY column in the SS_FITLER_CONFIG would be set to 1 and query could be simplified as shown here,</pre><pre>SELECT CITY_NM AS value, CD AS name FROM &lt;schema_name&gt;.EG_CITY_CODE</pre><ul><li>Filter Config Example 4: Country is configured as “string” (string list), this is a category 2 type the coach view retrieves the configuration and executes the query that is stored in the FILTER_QRY column. Unlike the “nvp “query of “Filter Config Example 3” this query maps the values as name, the query reader maps the name to value for displaying to the user.</li></ul><pre>SELECT COUNTRY AS NAME FROM &lt;schema_name&gt;.EG_PRODUCT_PURCHASE GROUP BY COUNTRY</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWaWmmYwKPt2-e-xYiWDbA.png" /><figcaption>Figure 10: Filter Config Example 4</figcaption></figure><p>4. Sort Config Service Call</p><p>The Sort configuration is a separate configuration from the filter, as sorting does not rely on data in the column it is a much simpler configuration. Figure 11 details the SS_SORT_CONFIG table definition and Table 3 provides column description of the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*JK-wAPJ7nhMC4KhzuNimiQ.png" /><figcaption>Figure 11: SS_SORT_CONFIG Definition</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SxiPECYiNpH3l8mOFxEnFw.png" /><figcaption>Table 3: SS_SORT_CONFIG Column Descriptions</figcaption></figure><ul><li>Sort Config Example 1: The configuration of the sort is a row for each column to be sorted, grouped by a view name. When selecting multiple sorts, the order is determined by the order the user selects the sort items.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrxmnaLRkQnJ5CaAaUPLGg.png" /><figcaption>Figure 12: Sort Config Example 1</figcaption></figure><h3>Filter Changed Event and Paging Section</h3><p>Once configured for a view the coach view will support the creation of combinations of filters and sorting. While combinations are possible the intent for usage should remain constant it is about quickly simplifying the data view for a use to find and work with the data they need.</p><p>Multiple Filters can be applied at one time, they will be passed to the backend as a List of FilterData, the order of filters in the list is based on the order the filter is added. Likewise, data can be filtered and sorted at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*G1RdwRaKmsabJnzv6WKibQ.png" /><figcaption>Figure 13: Multiple Filter and Sort OnChange Event occurs for each filter and sort</figcaption></figure><p>When the filter or sort is modified or cleared the filter, “On Change” event is thrown. This is the default behavior but a manual apply can be configured in the configuration that would then require the user clicking the “Apply” button that is visible on view under this configuration. This configuration is more efficient when it comes to managing the number of backend calls. In the case of manual apply the “On Change” event is only triggered when the button is clicked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*ehr9cpenvo6idac4Ow8Z6w.png" /><figcaption>Figure 14: Multiple Filter and Sort OnChange Event occurs only when the Apply button clicked</figcaption></figure><p>The “On Change” event exposes the current filter and sort information’s the parameters passed to the event are FilterData&lt;List&gt; and SortConfig&lt;List&gt;</p><p>When using the filter together with the Paging Section variables of this type are mapped to the paging section configuration. Changing the values and calling init on the paging section will refresh the table content inside the paging section. After the onChange event occurs the filter and sort data should be updated and then call <em>first()</em> or <em>init()</em> function on the PagingSection coach view.</p><h3>Example Paging Section and Filter Coach View</h3><p>The paging section facilitates the movement of the filtering and sorting data to the data service that is configured on the Paging Section.</p><p>Setting up the Filter and PagingSection to work together is easy, we will now step though setting up the example shown in Figure 15. In this section the details to setup a paging section and filter coach view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*Be943ZGaYEXHdzRNrKRioQ.png" /><figcaption>Figure 15: Unfiltered Data page with Filter and Paging Section</figcaption></figure><p><em>The anatomy of this example is three coach views as highlighted in Figure 16</em></p><ol><li><em>PurchaseProductTableCV</em></li><li><em>PagingSectionCV</em></li><li><em>TableFilterCV</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uBHYCJtPxn98g9CgwgUH7g.png" /><figcaption>Figure 16: Three Highlighted Coach Views</figcaption></figure><p>The <em>“PurcahseProductTableCV”</em> has a binding to the list data that will be ultimately displayed in the Table for showing the data. The same list is also bound to the Paging Section. Configuration for the coach view includes a FilterDataSet and PagingSectionInit business objects, the first is used by the table filter coach view binding and the second is used to set the configuration on the paging section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LE5HGdDQzk4ck3TKab0F-w.png" /><figcaption>Figure 17: PurchaseProdcutTableCV Binding and Configuration</figcaption></figure><p>The PagingSectionInit is initialized in the CSHS variable defaults. Each of these values maps to the equivalent configuration item for the <a href="https://medium.com/ibm-business-automation-workflow-server-side-paging-section-asset-aac32ff324f3">PagingSection coach view</a>, see the earlier post for more details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*fGEYe-k0BWcJ_jfTSAd-qw.png" /><figcaption>Figure 18: PagingSectionInit Business Object</figcaption></figure><p>The passed in values are mapped to the paging section. The paging section binds to the business object list and the configuration is linked to the attributes of the PagingSectionInit business variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1ONn078wNrbheAN8AqttA.png" /><figcaption>Figure 19: Paging Section Binding</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9YnOeg9rHQOFVTwyBMkYw.png" /><figcaption>Figure 20: Paging Section Configuration</figcaption></figure><p>The filter coach view is setup inside a “deferred section” that is loaded initially when the “Show Filter” button is clicked.</p><pre>Note: The deferred section is set to visibility NONE, so you need to click &quot;Show invisible items&quot; to see the filter configuration in the example</pre><p>The loading of the deferred section will trigger the configuration loading for the filter coach view. Using such a section is not essential for the example, it is typical of the use we have seen and a common practice, so the page only loads essential features on load. The onClick Event of the “Show Filter” button calls the <a href="https://github.com/IBM-BAW-Assets/paging-section-tk/blob/master/snippets/showHideFilters.js"><strong><em>showHideFilters()</em></strong></a> function. If the deferred section is not yet loaded, the load is initiated when the loaded event occurs the <em>showHideFilters()</em> function is called again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnwL45_zJc1jeJZaU-Y7oA.png" /><figcaption>Figure 21: Button and Deferred Section Event calls to <em>showhideFilters()</em> function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-VeXJ3d7lX4RgcOmPFUuQ.png" /><figcaption>Figure 22: <em>PurcahseProductTableCV:showHideFilters()</em></figcaption></figure><p>Before the deferred section visibility was set to None, the Filter (TableFilterCV) coach view is configured, binding the passed in variable filterDataSet and setting the filter configuration, this is shown in Figure 23.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M82UNe-pv-WyocRg5rLUVg.png" /><figcaption>Figure 23 Binding and Configuration for TableFilterCV</figcaption></figure><p>Having setup the Filter and Paging section coach views, the final step is to link them so that when the onChange event occurs in the filter it triggers the paging in the paging section with the updated filter data.</p><p>When the filter changes the <em>onChange</em> event occurs and the <a href="https://github.com/IBM-BAW-Assets/paging-section-tk/blob/master/snippets/filterSortOnChangedEvent.js"><strong><em>filterSortChangedEvent()</em></strong></a> function is invoked (Figure 24), in this function the filter and sort data is updated, and then the <strong><em>first()</em></strong> function on the paging section is invoked (Figure 25).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*XjnRphRCJoy1hBXRtXGwmA.png" /><figcaption>Figure 24: TableFilterCV:onChange Event</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51xISnydXJ9ExyPCCIg7Hw.png" /><figcaption>Figure 25: <em>PurchaseProductTableCV:filterSortOnChangedEvent function</em></figcaption></figure><pre>For the purpose of the example the data is logged to the console, but this is not necessary.</pre><h3>Server-Side Query modifications with Filtering and Sorting</h3><p>Identifying the filtering and sorting to be completed is half of the action, this section focuses on how this data is used to modify the server-side query.</p><pre>Would like to remind you at this time that the data design will be impacted by excessive filtering and sorting, and on large tables the wrong choices could have performance impacts. So, while a useful business tool please take care to consider and test the impacts of your filtering and sorting choices.</pre><p>In the upcoming section we shall illustrate the additional server-side code for adding the WHERE and ORDER by statements.</p><p>Our assumptions for the following example (which you could be altered based on your own needs):</p><p>1. While the data should only be coming from the filter data requests can be faked so we still recommend using parameterized queries and validate the DB column names.</p><p>2. Multiple filter/sort options compound meaning AND statements not OR.</p><p>3. Multiple filters/sort are applied in the order they are set (So there is no additional logic to filter based on columns selected).</p><p>4. Filters are exact matches only. We are not in this example using like or other options on the submitted data.</p><p>With these assumptions in place an execution pattern shown in Figure 26 that you can reuse to quickly get started with the filter using a three (3) steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*1_9OYo7AXkApU5QB6bMxYQ.png" /><figcaption>Figure 26: Data Service pattern. Example Get Product Purchase Data List with Filter</figcaption></figure><h4>Step 1: Set base SQL statements</h4><ul><li>Set the business object query</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*FzdoXmMpdnx6eaJpihWvSw.png" /><figcaption>Figure 27: Example Select to Business Object Query</figcaption></figure><ul><li>Set the total records query</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*bZz4OsdkdY5hNCbpaCmo2g.png" /><figcaption>Figure 28: Query the total records in the dataset</figcaption></figure><pre>The total could be manipulated based on filter also to represent the count based on filter but for our business needs if that was preferred to reflect a total number of unfiltered records. So, no filtering is applied to the count in this example.</pre><h4>Step 2: Build WHERE and ORDER by clause</h4><p>Here we will provide a sample block of code that requires minimal change that can be reused over and over. This code sets up the parameterized section of the WHERE and adds offset conditions needed when paging. As it is largely reusable you can look at the example in the toolkit or get the <a href="https://github.com/IBM-BAW-Assets/paging-section-tk/blob/master/snippets/where-and-order-pattern.js">code snippet</a> in from git repository. Here we will focus on detailing the flow of the code and the likely changes that will be needed.</p><p>A simple code flow algorithm is detailed in Figure 29 that captures what the WHERE and ORDER series of functions does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*dK1tCYLIkcgLpfFZe81OOw.png" /><figcaption>Figure 29: Code Flow Algorithm</figcaption></figure><p>The section of code that needs to be modified is the <em>initTableProperties()</em> function, this function needs to setup a list of ColumnParameter that is specific to the table that is being mapped. The column parameter maps the column name and the SQL Parameter type. By putting the column name here, it helps protect against injections on the SQL and helps setup parameterized value substitution. Change the <em>initTableProperties() </em>function to represent the columns specific to the table being queried.</p><h4>Step 3: Setup the Execute SQL statements</h4><p>The execute are standard SQLExecute statements, one retrieves the total records and the other retrieves the filtered and ordered data. As common with using this the data mapping is essential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AaNWh2rihJj85pBsISTsrg.png" /><figcaption>Figure 30 Example SQL Execute Data Mapping</figcaption></figure><h4>Step 4: Walkthrough of Query Code using Debugger</h4><p>Now we shall look at an example and examine the outputs of this standardized code to clearly illustrate the inputs and outputs here.</p><ol><li><strong>Setup Mock Input Data</strong></li></ol><p>In our case we setup the default values on the service flow inputs of the service to mock the data coming into the service. Be careful with this approach and remove all defaults before promoting code.</p><pre>input = No default set<br>pageSize = 5;<br>currPage = 1;<br>filterDataList = List of three filter type &quot;nvp&quot; (name Value Pair), dateR (date range), and intValue (Integer Value Pair) see <a href="https://github.com/IBM-BAW-Assets/paging-section-tk/blob/master/snippets/default-filterDataList.js">code snippet</a> here.<br>sortConfigList =  1 sort based on PURCHASE_DT and sort ascending see <a href="https://github.com/IBM-BAW-Assets/paging-section-tk/blob/master/snippets/default-SortConfigList.js">code snippet</a> here. </pre><p>2. <strong>Walk the Debugger to the point Pre-SQL Execute</strong></p><p>With the mock data setup walk the debugger up to the SQL Execute statement then we shall take a look at what the<strong> Filter and Sort</strong> script task has done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ageFXtH9_r52ViSzMbcQJw.png" /><figcaption>Figure 31 Walk Debugger to the Execute SQL Task</figcaption></figure><p>Let’s now examine the SQL String and the SQL parameters. The original SQL string is shown in Figure 25 and there is no WHERE, ORDER BY or LIMIT portions in the statement this has been inserted dynamically based on the query inputs.</p><pre>SELECT <br>  EPP.ID AS ID,<br>  RECEIPT_ID AS RECEIPTID,<br>  PURCHASE_DT AS PURCHASEDT,<br>  PURCHASE_AMT AS PURCHASEAMT,<br>  COUNTRY AS COUNTRY,<br>  CITY_CD AS CITYCD,<br>  ECC.CITY_NM AS CITYNM,<br>  PRODUCT_TP AS PRODUCTTP,<br>  EPT.PRODUCT_NM AS PRODUCTNM<br>FROM PROTELDBNEW.EG_PRODUCT_PURCHASE EPP<br>LEFT JOIN PROTELDBNEW.EG_CITY_CODE ECC ON ECC.CD = EPP.CITY_CD<br>LEFT JOIN PROTELDBNEW.EG_PRODUCT_TYPE EPT ON EPP.PRODUCT_TP = EPT.ID<br>WHERE (CITY_CD IN (?, ?)) AND (PURCHASE_DT BETWEEN ? AND ?) AND (PRODUCT_TP= ?)<br>ORDER BY PURCHASE_DT ASC<br>LIMIT 5 OFFSET 0</pre><p>Examining the WHERE condition first, this is built based on the 3 filters in the mock-up data Filter data list. The first entry CITY_CD is a list of 2 and maps to a “IN” clause with two parameter markers (?) added for each entry. The second entry was a date range and the BETWEEN is mapped for the range with a parameter marker (?) inserted for the ‘from’ and the ‘to’ values. Finally, the PRODUCT_TYPE is integer value pair which maps to the integer list in the filter data list but when the list only has one value the equals is used and not the IN.</p><p>The ORDER By clause is straight forward for each entry in the sortConfigList a value is added in the ORDER by clause.</p><p>The LIMIT on the end ensures that the current page and page size are honored when executing the query.</p><p>As the WHERE condition is built, the parameter configuration from the <em>initTableProperties() </em>for the column are used to build up the sqlParameters to substitute. The parameters will be substituted at runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*85YY9MM2Gel2yFNtaBiEoQ.png" /><figcaption>Figure 32 SQL Parameters</figcaption></figure><p>You can now step to the end and see the results mapped into the result list.</p><pre>Make sure you have data that satisfies all your example conditions or simplify the mock-up start with one filter.</pre><h3>Advanced configuration</h3><p>The following summarizes the two advanced configurations that the filter supports.</p><h4>Filter Cache Configuration</h4><p>The first is the ability to cache the result from the filter query. When enabled the Filter Cache will cache all the queriers read from the configuration database and will cache the results for the queries with the CACHE_QRY column set to 1. Enable the cache by</p><ul><li>Configure an object cache instance in the Business Automation Workflow administration console with the below properties.</li></ul><pre>Name      = Filter Cache<br>JNDI name = services/cache/fd</pre><pre>Keep other default values for development and tune sizing based on number of objects and queries in testing.</pre><ul><li>In the toolkit set the environment variable to enable the cache</li></ul><pre>// Code value is literal string match must be true to enable.<br>ENABLE_FILTER_CACHE=true</pre><p>It should be noted that in the current implementation “Applied Filters” which will be discussed shortly has no built-in caching. Caching of the data returned applies to Category Type 2 Filter types.</p><h4>Applied Filter Configuration</h4><p>The concept of applied filter allows you to infer a relationship from one filter to another, for example, if I select filter of country then I want to select a filter by associating the country to the city through the applied filter then the cities in the filter would be limited to only cities of the currently filtered countries.</p><p>In the current version of the framework the query for this dependant filtering must be explicitly entered we do not currently have a configuration that will support the injection of the dependant filter.</p><p>This is a plan to enhance this to be configured as with standard filters, however as of current version the developer needs to insert a branch into the “Get Filter Data Applied Filter” service, adding the conditional query. See the code and service flow for example.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b163f78976b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-filtering-and-sorting-coach-view-for-server-side-paging-section-8b163f78976b">IBM Business Automation Workflow Filtering and Sorting Coach View for Server Side Paging Section…</a> was originally published in <a href="https://medium.com/ibm-business-automation-ap-el">IBM Digital Business Automation Tips and Assets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Business Automation Workflow, Working with Deferred Sections]]></title>
            <link>https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-working-with-deferred-sections-fe04ab9d025a?source=rss-4325b249acb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe04ab9d025a</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[baw]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[leonard blunt]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 09:01:00 GMT</pubDate>
            <atom:updated>2020-03-17T09:01:00.900Z</atom:updated>
            <content:encoded><![CDATA[<p>Deferred Sections are a highly valuable tool available to ensure parts of the UI are only loaded when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*rfOPULS3tPJ4gKPgJk1xUg.jpeg" /><figcaption><a href="https://www.123rf.com/profile_desdemona72">Alain Lacroix</a> © <a href="http://www.123rf.com/">123RF.com</a></figcaption></figure><p><em>Authors: </em><a href="https://medium.com/@leonard.blunt"><em>Leonard Blunt</em></a><em> , </em><a href="https://medium.com/@gregorius.adrian1994"><em>Greg Ekaprana</em></a><em>, </em><a href="https://medium.com/@okkasudaryanto"><em>Okka Sudaryanto</em></a><em>, </em><a href="https://medium.com/@diorellatom"><em>Diorella Mari Tom</em></a></p><h4>Code Repository</h4><p><em>Client Side Human Service : Deferred Section Simple Example in </em><a href="https://github.com/IBM-BAW-Assets/tips-for-baw-tk">tips-for-baw-tk</a></p><h3>Introduction</h3><p>When working in IBM Business Automation Workflow it can occur that Client-Side Human Service and/or Coach Views can become complex and embed many other coach views, such as modals, tabs and hidden sections all of which are rendered when the page loads. In complex coach views this typically result in many load functions being called and even superfluous data being retrieved. The loading of many complex views can slow the page rendering and create a perceived performance issue. Deferred Sections as their name indicates allows us to control when sections of the UI are loaded. By managing how the different parts of the UI are loaded we can make sure that only required views and data are loaded, which means a user only waits for what is needed improving initial load times. Deferred sections are also beneficial when managing dependencies between parts of the coach view</p><pre>Architecturally we promote simple targeted UI with less data. But when this is not possible good design and use of a deferred sections can significantly improve real and perceived load times for a user. </pre><p>Deferred sections stop the views within them from being loaded until the <em>lazyLoad()</em> function on the Deferred Section component is invoked. The <em>lazyLoad()</em> function can be directly invoked, for example called as a part of a user event such as a button click event, or such as when a service call completes successfully. This function an also be auto triggered by setting the auto load configuration property of the deferred section.</p><p>Here are some tips for good use cases for using Deferred Sections:</p><ol><li>When using Tabs or Stacks embed the content of each Tab in a deferred section. Set the first tab to auto load and use the on click event to load subsequent tabs</li><li>Deferred Section also could be used inside the modal, especially for a modal that has a function on load. As many modals are situational it is common that a modal view may not be displayed, so the use of deferred sections reduces the loading of unneeded views.</li><li>When sections are hidden should be built inside a deferred section and triggered to load only as needed.</li></ol><h3>Using Auto-Load Configuration</h3><p>This is the simpler of the two options and can serve to help prioritize loading of different parts of a view by delaying a different part of the view. We shall mock-up a simple example that illustrates the auto load and the delay. This example in in the sample toolkit in git.</p><p>Let’s look at the anatomy of the example client side human service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0aaE_qrLwkwXmA5BfQDCg.png" /><figcaption>Figure 1 Anatomy of Example Coaches</figcaption></figure><ol><li>Incorporates a Stack with Two buttons for triggering change to the stack tab that is displayed (Will elaborate this on the event driven load).</li><li>The deferred section. By placing the deferred section at the client-side human service, we make it easier to control the loading of embedded views.</li><li>A simple coach view that has a label and when it loads it sets an output text displaying the load time. This is a very simple way to illustrate the deferred section in action.</li></ol><pre>You will need to make a choice when using tabs or stack as to whether you want a deferred section on the &quot;default&quot; tab. If it is possible for the default to change or likely to change it will simplify changes later if included in initial construction.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pde_FkmCT23qLnFi-W6jWQ.png" /><figcaption>Figure 2: Load Automatically Configuration</figcaption></figure><p>In Figure 2, the Load automatically configuration is shown illustrating that the section will load 5000 milliseconds after the deferred section is loaded. The result of running this simple example is illustrated in Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XF_Pr0Yba3xfq2WJzjW-1g.png" /><figcaption>Figure 3 Simple Example showing the section Load delayed 5 seconds</figcaption></figure><pre>If you have a deferred section in place but decide a delay is not required can set the delay to 0 rather than change code.</pre><h3>Manually Triggering the Deferred Section Load</h3><p>When using deferred sections, it is much more common to use an external event to trigger the loading of the section. Triggering the lazyLoad() is as simple as calling the function on the deferred section. The method takes two parameters the time to delay before the load and a boolean that indicates if the <em>“on lazy-loaded event”</em> should trigger once the section is loaded.</p><pre>The &quot;on lazy-loaded event&quot; can be both useful and important if the embedded views need to refresh or load data. It is important to understand the deferred section defers initial loading of the components inside. But once loaded additional calls to the lazyload() function <strong>DOES NOT RELOAD</strong> the components. But it will throw the &quot;on lazy-loaded event&quot; each time. This event can be used to trigger updating or loading of data.</pre><p>Continuing the example for the second tab of the stack we shall manually trigger the loading of the deferred section by using the “on Click Event” “Category 2” Button which will load the deferred section. When the deferred section load is complete, we set the current pane using the “setCurrentPane” function on the stack. So, in fact we only show the pane once the section is loaded.</p><p>Step 1: Deferred Section Configuration Auto is Off</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3tH5VlZzKPungMtO-CiPyQ.png" /><figcaption>Figure 4 Disable Lazy-load automatically</figcaption></figure><p>Step 2: Call the lazyLoad from the Buttons on Click</p><pre>${Deferred_Section2}.lazyLoad(0, true);</pre><p>On the onClick event of the Category 2 button we call the lazyLoad function. The first parameter 0 indicates do not delay and true indicates that the on lazy-loaded event should be thrown once the section is loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHTucrHw76g3hlpam9LQcA.png" /><figcaption>Figure 5 Call the lazy load on the deferred section</figcaption></figure><p>Step 3: Change the current pane when the deferred section is loaded</p><pre>${CategoryStack}.setCurrentPane(1);</pre><p>Even though the deferred section only loads once each time the pane changes back and forth the event will trigger because we set true in the lazyLoad function call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SB98BAawz-8ica_4H3paYQ.png" /><figcaption>Figure 6 Set the current pane when the section is loaded</figcaption></figure><pre>Deferred_Section2 and CategoryStack are the &quot;Control ID&quot; for the deferred section and the stack respectively.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogFlaLLkZC13BAnTEix-Eg.png" /><figcaption>Figure 7 Control ID for the Deferred section and the Stack</figcaption></figure><h3>Data Change and Reload Trigger</h3><p>As noted above once a section is loaded it will not auto trigger the reload of embedded views. In most cases this is perfect as you only want to load the embedded views once but there are times when the embedded view may require updating based on some external context. We will create a simple example here to show one way you can handle this.</p><p><em>The scenario is from the main view the user selects a dataset to display. Once displayed the user chooses data from the data set on a modal, and the selected data is updated in a table. The Modal will include an initial deferred section but once loaded on subsequent calls the product group selected needs to be passed and refreshed.</em></p><p>Step 1 Add a new tab to the stack setting up the events and deferred section as with Category 2 discussed above.</p><p>Step 2 Set up data selection</p><p>The data selection will include a selection list (we will make this a static list of “product groups”.</p><pre>When using a selected list any bound variables are not automatically updated, this occurs on the boundary event at our last check. </pre><p>So, we use the onChange event of the single select to push the select item to a hidden Data coach view. In this example, this data will be used to influence which group of products is shown on the modal.</p><pre>${Data1}.setValue(me.getSelectedItem());<br>${Data2}.setValue(me.getSelectedItem());</pre><pre>${Modal_Section1}.show();</pre><p>In the modal we have a coach view that takes the input group and makes a service call to get the data list for the input product group. The modal then allows the user to select the products they want and click add, added items are updated back into the selected product table.</p><p>What is significant related to the deferred section is that in the modal we placed a deferred section and if all we do is show and hide the modal the deferred section completes the initial load what you will quickly note is that despite changes to the selected group only the initially selected group data gets shown see Figure 8, we can see that having selected the product group 2 originally when product group 3 is selected the data still shows the Group 2 data. To reliably refresh the data, we use the “on lazy-loaded event” to trigger a refresh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2HPUkIo2gtMKRX4nqBKmw.png" /><figcaption>Figure 8 the Product list for Group 3 is wrong</figcaption></figure><pre>We are highlighting this to remind you that the deferred section loads the view components once. Data changes do not change the load state unless you explicitly reload or refresh the view.</pre><p>In the embedded coach view ProductSelector there exists a JavaScript function called refresh that invokes the service call to load the data.</p><pre>var _this = this;<br></pre><pre>this.refresh = function() {</pre><pre>   // productList2 is the Control ID for the Table<br>   _this.ui.get(&quot;productList2&quot;).clear();</pre><pre>   // Service_Call1 is the Control ID for the Service Call<br>   var param = _this.context.options.groupId.get(&quot;value&quot;);<br>   _this.ui.get(&quot;Service_Call1&quot;).execute(param);<br>}</pre><p>We change the on lazy-loaded event to call this function</p><pre>${ProductSelector1}.refresh();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WWu_h2sf956t8Ts0RNWBsw.png" /><figcaption>Figure 9 Call refresh on Embedded Coach View</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwSF1ouo3a5aZN1XEIVasg.png" /><figcaption>Figure 10 With the refresh being called the embedded view is updated</figcaption></figure><p>Step 3 to complete add selected records to the table in the main view</p><p>This is done by getting the selected records from the ProductSelector coach view using the <em>getSelectedRecords()</em> function.</p><pre>this.getSelectedRecords = function() {</pre><pre>   // productList2 is the Control ID for the Table<br>   return _this.ui.get(&quot;productList2&quot;).getSelectedRecords(true);</pre><pre>}</pre><p>In the “On Click” event of the the “Add” button for the modal, in addition to closing the modal the the records are added to the main table on the view.</p><pre>${Modal_Section1}.hide();<br>var selected = ${ProductSelector1}.getSelectedRecords();<br>${productList1}.appendElements(selected);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aPTk_WFBItSoSRG5e6U4dQ.png" /><figcaption>Figure 11 Calls to add the selected records to the product table in the stack</figcaption></figure><pre>This is a simple example of course, so no validation of de-duplication or sorting regarding the overall table is completed here. We are focused on illustrating the use of the deferred section to initially delay the loading of the view components contained within the modal. Then secondly to highlight the need to refresh changing dependent data on subsequent calls to the modal. </pre><pre>This refresh and change is not specific to deferred sections, but a misunderstanding of what &quot;on lazy-loaded event&quot; means has been known for developers to think their embedded views will have been reloaded and they are not. </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wU7VWjJgRALfj4OyOcF7Pw.png" /><figcaption>Figure 11 Shows three steps (1) User adds products from Group 1, (2) User Adds Products from Group 3 and (3) The added products from Group 1 and Group 3</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe04ab9d025a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-business-automation-ap-el/ibm-business-automation-workflow-working-with-deferred-sections-fe04ab9d025a">IBM Business Automation Workflow, Working with Deferred Sections</a> was originally published in <a href="https://medium.com/ibm-business-automation-ap-el">IBM Digital Business Automation Tips and Assets</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>