<?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[K2 Dev — EN - Medium]]></title>
        <description><![CDATA[A K2 platform development’s tip and trick in English languague - Medium]]></description>
        <link>https://medium.com/k2-dev-en?source=rss----c9c08bf56301---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>K2 Dev — EN - Medium</title>
            <link>https://medium.com/k2-dev-en?source=rss----c9c08bf56301---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:23:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/k2-dev-en" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Send Email with Table Content (Low Code Version)]]></title>
            <link>https://medium.com/k2-dev-en/send-email-with-table-content-low-code-version-49f58b2fceb1?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/49f58b2fceb1</guid>
            <category><![CDATA[email]]></category>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[low-code-development]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[table]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Mon, 25 May 2020 14:10:55 GMT</pubDate>
            <atom:updated>2020-05-25T14:10:55.696Z</atom:updated>
            <content:encoded><![CDATA[<p>When we create workflow application, workflow will send notification to approvers. In some cases, we have form that input items of request and we want to display those items in email for approver. How can we do that?</p><p><strong>First Solution</strong> is using stored procedure in database to return html table</p><p><strong>Second Solution</strong> is writing coding (REST or .NET) to return html table</p><p><strong>Third Solution</strong> is the low code way using K2 workflow feature (need to be K2 version 5.0 or above — in this blog I use K2 5.3)</p><h3>What to know before start?</h3><p>What we need to know is how to create table in html format. In this blog, I’ll use Product Name, Product Number and Quantity to show in table. We’ll using below html table tag (if you don’t know html tag, please search using google)</p><blockquote>&lt;table&gt;</blockquote><blockquote>&lt;tr&gt;</blockquote><blockquote>&lt;th&gt;Product Name&lt;/th&gt;</blockquote><blockquote>&lt;th&gt;Product Number&lt;/th&gt;</blockquote><blockquote>&lt;th&gt;Quantity&lt;/th&gt;</blockquote><blockquote>&lt;/tr&gt;</blockquote><blockquote>&lt;tr&gt;</blockquote><blockquote>&lt;td&gt;Product Name&lt;/td&gt;</blockquote><blockquote>&lt;td&gt;Product Number&lt;/td&gt;</blockquote><blockquote>&lt;td&gt;Quantity&lt;/td&gt;</blockquote><blockquote>&lt;/tr&gt;</blockquote><blockquote>&lt;/table&gt;</blockquote><h3>Get Start</h3><p>After we create workflow, we need to create one variable to keep html table. In this blog, I’ll use name as TableContent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*kVCZeZKZY6wu3DAQIW_SmA.png" /><figcaption>Variable</figcaption></figure><p>Then we’ll configure workflow as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*2_PaLUKIsjWkO-I8tPNccQ.png" /><figcaption>Add HTML Table Content</figcaption></figure><h3>First Step — Set Table Header</h3><p>In this step, we’ll configure table header by using <strong>Set Variables </strong>step.<strong> </strong>In my case, I use 3 columns so I’ll use table tag as below (I configure table border=”1” because I want to have table border)</p><blockquote>&lt;table border=”1”&gt;</blockquote><blockquote>&lt;tr&gt;</blockquote><blockquote>&lt;th&gt;Product Name&lt;/th&gt;</blockquote><blockquote>&lt;th&gt;Product Number&lt;/th&gt;</blockquote><blockquote>&lt;th&gt;Quantity&lt;/th&gt;</blockquote><blockquote>&lt;/tr&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*LW4VW6vMIsOTn14VFS_AIQ.png" /><figcaption>Set Table Header</figcaption></figure><h3>Second Step — Get List of Items</h3><p>We’ll use <strong>Create Reference </strong>step<strong> </strong>to get display data. We’ll use SmartObject that keep items data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*4L84maP_7TMx_BoyG-b1lw.png" /><figcaption>Create Reference — Configure SMO</figcaption></figure><p>For Input Mapping setting, we use HeaderID to get Items of document that we input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*A4q5-_jkpC_LiX2Idlr-Xg.png" /><figcaption>Create Reference — Input Mappings</figcaption></figure><p>For Output Mappings, we need to click Create to create Reference (K2 will default the name of reference. If we want to change, we can change). For List Options, select All to get all items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*W6xvo3ih_JVR-93iHdmNXQ.png" /><figcaption>Create Reference — Create Output Mappings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*nA3Ahe-DY9jytpI5LM5oXw.png" /><figcaption>Create Reference — Input Output Mapping</figcaption></figure><h3>Third Step — Loop</h3><p>After we got Reference, we’ll configure <strong>Loop</strong> step. This step will tell K2 to use reference that we create in 2nd step for looping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*PuqegpVEnoA5fjwphLOYZg.png" /><figcaption>Loop — Set Loop Reference</figcaption></figure><p>After we set reference, K2 will create List Item automatically. We’ll use this List Item as current item when we do looping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*PAuEcjm1cc8JE_ekMgHoTg.png" /><figcaption>Loop — List Item Reference</figcaption></figure><h3>Forth Step — Add Items to Content</h3><p>We’ll use <strong>Set Variables</strong> step to add row to table. We’ll concatenate string in below pattern and replace the <strong>[bold]</strong> word with Variable and column from List Item Reference.</p><blockquote><strong>[TableContent]</strong>&lt;tr&gt;&lt;td&gt;<strong>[Product]</strong>&lt;/td&gt;&lt;td&gt;<strong>[ProductNumber]</strong>&lt;/td&gt;&lt;td&gt;<strong>[Quantity]</strong>&lt;/td&gt;&lt;/tr&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*0KROr1s6EbQAFNgGq7ubDg.png" /><figcaption>Add Items to Content — Concatenate Rows in Table</figcaption></figure><h3>Fifth Step — Close Table</h3><p>After we add all rows to table, we’ll add close table tag (&lt;/table&gt;) at the end of TableContent variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*NZipDJLhKWApbN63M5olww.png" /><figcaption>Close Table</figcaption></figure><h3>Complete The Solution</h3><p>When finish all five steps, we’ll have content to use in email event or notification in user task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*6keWLB-ezy-UaEv0yTt1mg.png" /><figcaption>Using in Email</figcaption></figure><p>Then we’ll testing with the workflow below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*iYCts4DuuydHrODLFsXIJQ.png" /><figcaption>Full Workflow</figcaption></figure><p>Input data in form and wait for an email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQLzXmnuzFrzsraMyek-bw.png" /><figcaption>Form Data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*_Xa-wcZTSph21QBH6deglA.png" /><figcaption>Email Content</figcaption></figure><p>We can use standard feature to create a semi-complex application. Strong point is we don’t need to coding and don’t need any deep programming knowledge (using only simple html). But weak point is we can’t do reuseable function. Can only copy pattern for using in every workflow.</p><p>That’s all for this time :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49f58b2fceb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/send-email-with-table-content-low-code-version-49f58b2fceb1">Send Email with Table Content (Low Code Version)</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K2 and AAD Sync Error DeltaLink older than 30 days]]></title>
            <link>https://medium.com/k2-dev-en/k2-and-aad-sync-error-deltalink-older-than-30-days-8c4efff6bd77?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/8c4efff6bd77</guid>
            <category><![CDATA[k2-blackpearl]]></category>
            <category><![CDATA[error]]></category>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[aad]]></category>
            <category><![CDATA[azure-active-directory]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 11:32:20 GMT</pubDate>
            <atom:updated>2020-03-27T11:32:20.907Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve some queries from customer and partner about K2 integration with AAD (Azure Active Directory). If we use cloud server that join AAD, we don’t need to do anything. But if we use K2 on premise, we can configure manual AAD integration follow the step in <a href="https://help.k2.com/onlinehelp/k2blackpearl/icg/4.7/default.htm#Configure/SF/MultiAuthAAD.htm">https://help.k2.com/onlinehelp/k2blackpearl/icg/4.7/default.htm#Configure/SF/MultiAuthAAD.htm</a>. After we do manual configuration, we need to do full sync data from AAD and set sync schedule using step in <a href="https://help.k2.com/kb002707">https://help.k2.com/kb002707</a>.</p><h3>Problem</h3><p>After we configure K2 with AAD, K2 will queries the change in AAD and sync back to K2. Sometimes we’ll found error as below “DeltaLink older than 30 days is not supported.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*6mVW0EMZJzi4eai_.png" /></figure><h3>Solution</h3><p>Backup K2 database then run script below ให้ทำการ backup database K2 <strong>*Recommend to run after business hour because it may interfere other processes</strong></p><p>UPDATE [SyncEngine].[RepositoryConfig]</p><p>SET [ConfigValue] = ‘’</p><p>WHERE [ConfigKey] in (‘IdentityState’,’MembershipState’)</p><p>After run script, we need to do full sync and set sync schedule again. Problem should be resolved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c4efff6bd77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-and-aad-sync-error-deltalink-older-than-30-days-8c4efff6bd77">K2 and AAD Sync Error DeltaLink older than 30 days</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Workspace Url Blocked on Laptop]]></title>
            <link>https://medium.com/k2-dev-en/workspace-url-blocked-on-laptop-6fe72a292841?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/6fe72a292841</guid>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[k2-workspace]]></category>
            <category><![CDATA[workspace]]></category>
            <category><![CDATA[block]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Tue, 11 Feb 2020 07:51:47 GMT</pubDate>
            <atom:updated>2020-02-11T07:51:47.684Z</atom:updated>
            <content:encoded><![CDATA[<p>K2 have 2 applications for mobile. K2 Mobile for K2 4.7 and below. K2 Workspace for K2 5.0 and above.</p><p>When we use K2 Five and try to access workspace url with mobile’s browser, K2 will display blocked message and tell user to download K2 workspace application.</p><h3>Issue</h3><p>We found issue in some environments. If we open workspace url using mobile’s browser, then we’ll see same blocked message when we access workspace url using same user account in laptop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*IbvBcXlcM_4pdZWg9ZUusg.png" /><figcaption>Blocked Screen</figcaption></figure><h3>Solution</h3><p>Followed instruction below (tested in K2 5.2, K2 5.3)</p><ul><li>Backup K2 SmartForms runtime’s web.config</li><li>Search for tag &lt;add name=”RT Profile” under &lt;caching&gt;</li><li>Add <strong>Browser</strong> in varyByCustom</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14YVZ9J0eF47rqYHeyORzQ.png" /><figcaption>Add Browser in web.config</figcaption></figure><ul><li>Save web.config</li><li>Perform iisreset</li></ul><p>Then we can access workspace url with laptop as normal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fe72a292841" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/workspace-url-blocked-on-laptop-6fe72a292841">Workspace Url Blocked on Laptop</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Design Thinking] — Practice for Design K2 Consuming Table]]></title>
            <link>https://medium.com/k2-dev-en/design-thinking-practice-for-design-k2-consuming-table-107bf75b7d46?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/107bf75b7d46</guid>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[k2]]></category>
            <category><![CDATA[k2-smartforms]]></category>
            <category><![CDATA[k2-blackpearl]]></category>
            <category><![CDATA[design-thinking]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Wed, 29 Jan 2020 13:16:26 GMT</pubDate>
            <atom:updated>2020-01-29T13:19:37.159Z</atom:updated>
            <content:encoded><![CDATA[<h3>[Design Thinking] — Practice for Design K2 Consuming Table</h3><p>This time I want to talk about design to develop K2 in proper way. So I’ll write a serie of blog about K2 design. The first blog will begin from design table that suitable for K2.</p><h3>Primary Key</h3><p>When we design a table, we’ll have 2 ways of design primary key. Design as running number or design with meaningful key. So I would recommend the first one, a running number primary key.</p><p>Example: If we want to design LeaveRequest table we have 2 options as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*lWymYQ9yyTirFs1UNyUfXQ.png" /><figcaption>Table with Running Number Primary Key</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*LGD2gHsINiM_wSARSfdoFQ.png" /><figcaption>Table with Meaningful Primary Key</figcaption></figure><p>K2 support both design. If we use the meaningful primary key and our form have save draft functionality, we need to generate a unique primary key for draft request. The effective way to generate unique primary key is create by stored procedure or coding.</p><p>If we use running number primary key, we don’t need to worry about generating temp primary key. Then we’ll generate document number after user start workflow.</p><h3>Normalization</h3><p>When we think about relational database design, we’ll think of Normalization. But in the real world, we can reduce normalization level to reduce the complexity of coding and performance impact in some situation. I’ll explain using 2 examples then we can see the same picture.</p><h4>First Case</h4><p>We want to keep customer information. Customer information will have marital status. List of option for marital status as below</p><ul><li>Single</li><li>Married</li><li>Widowed</li><li>Divorced</li></ul><p>We have 2 options here.</p><p><strong>First Option</strong> — Create table to keep marital status and keep marital status primary key in customer table. So we’ll get marital status description to show in the form.</p><p><strong>Second Option</strong> — We keep description in customer table directly.</p><p>If we didn’t change option for marital status frequently, I recommend to use second option.</p><p>If the option need to change frequently, we can design as separate table like first option. If we design as separate table, we need to think of the old data. In order to see the correct data, we can’t change description of the old option but add as new option and have flag to indicate that this option is active or not. Example: We select marital status as Single in the past. Now we change marital status description from Single to Very Single (not add new option as Very Single). If we see the old customer data that was created before the change, we’ll see marital status as Very Single too.</p><h4>Second Case</h4><p>We still discuss about customer data. We keep the information of salesperson that take care of customer. Salesperson was located at the branch of our company. So we have 2 options.</p><p><strong>First Option</strong> — In Customer table we keep SalesPersonID and SalesPerson table we’ll keep BranchID</p><p><strong>Second Option</strong> — In Customer table we keep both SalesPersonID and BranchID. In SalesPerson table we keep BranchID too.</p><p>So we have requirement to show branch that customer contact with. Showing data as a report in ListView.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C04nQMXAft3TvOMT4PsGxQ.png" /><figcaption>List View Report</figcaption></figure><p>Which option we’ll choose? Before make decision, we’ll see the pros and cons for each option.</p><h4>First Option</h4><p><strong>Pros — </strong>No need to keep data in 2 tables</p><p><strong>Cons</strong> — Need to join data from 3 tables</p><h4>Second Option</h4><p><strong>Pros</strong> — Easier to get data. If we use primary key datatype as number, it’s much easier because we can use List Display control or we can use SmartObject Association to display data.</p><p><strong>Cons</strong> — Need o keep data in 2 tables</p><p>If we see pros and cons above, we may think seem not different. Then we can’t decide what to use. So I think we need to see next criteria. How many columns to display and use for which objective?</p><h4>Number of Columns to use</h4><p>If we use only one column, I’ll keep BranchID in Customer table. Because we don’t need to create stored procedure or view to display data. If we display in list view, we can use list display control to get branch name (in case that we use number as primary key)</p><p>If we use more than 1 column, we’ll see next criteria.</p><h4>Objective</h4><p>If we use for checking data or display data in item view, I’ll keep BranchID in Customer table because we can use SmartObject method to get data of Branch table directly.</p><p>If we use for display in list view (display customer data with branch detail and branch address), I’ll not keep BranchID in Customer table. Because we still need to create stored procedure or view to display data in list view.</p><h3>Summary</h3><p>For the table design to use with K2. I recommend to create primary key as running number (because List Display control that we use to get description in List View can be use when primary key is number only) and reduce level of normalization. This will help us to reduce time to develop application and application will have better performance.</p><p>Some organization may have development policy that not allow to denormalize or keep data redundancy. But please keep in mind that we need to balance our development policy with the ease of development (time to develop), performance and maintenance ability of our application.</p><p>It’s all for the first blog of design thinking. See you next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=107bf75b7d46" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/design-thinking-practice-for-design-k2-consuming-table-107bf75b7d46">[Design Thinking] — Practice for Design K2 Consuming Table</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K2 Five Workflow.Client API Error: BootstrapContext]]></title>
            <link>https://medium.com/k2-dev-en/k2-five-workflow-client-api-error-bootstrapcontext-d03fbd41d9ae?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/d03fbd41d9ae</guid>
            <category><![CDATA[bootstrapcontext]]></category>
            <category><![CDATA[k2]]></category>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[error]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Mon, 20 Jan 2020 09:42:54 GMT</pubDate>
            <atom:updated>2020-01-20T09:42:54.705Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I’ve a task to create REST service to connect with K2 using dll. When we open connection with K2 workflow, we normally use below code.</p><blockquote><em>Connection WorkflowClientConnection = new Connection();</em></blockquote><blockquote><em>SCConnectionStringBuilder builder = new SCConnectionStringBuilder();</em></blockquote><blockquote><em>builder.Authenticate = true;</em></blockquote><blockquote><em>builder.Host = “localhost”;</em></blockquote><blockquote><em>builder.Port = 5252;</em></blockquote><blockquote><em>builder.Integrated = true;</em></blockquote><blockquote><em>builder.IsPrimaryLogin = true;</em></blockquote><blockquote><em>WorkflowClientConnection.Open(“localhost”, builder.ToString());</em></blockquote><blockquote><em>////Do your work</em></blockquote><blockquote><em>WorkflowClientConnection.Close();</em></blockquote><p>We’ve reference dll of K2 version 5.3. When we call “Open” method of class SourceCode.Workflow.Client.Connection, we’ll face the error <strong>Value cannot be null. Parameter name: BootstrapContext</strong></p><h3>Solution</h3><p>If we found above error, don’t panic. We didn’t do anything wrong, the problem is K2’s dll that we reference. We need to add more code to solve this issue.</p><blockquote><em>Connection WorkflowClientConnection = new Connection();</em></blockquote><blockquote><em>SCConnectionStringBuilder builder = new SCConnectionStringBuilder();</em></blockquote><blockquote><em>builder.Authenticate = true;</em></blockquote><blockquote><em>builder.Host = “localhost”;</em></blockquote><blockquote><em>builder.Port = 5252;</em></blockquote><blockquote><em>builder.Integrated = true;</em></blockquote><blockquote><em>builder.IsPrimaryLogin = true;</em></blockquote><blockquote><strong><em>var savePrincipal = System.Threading.Thread.CurrentPrincipal;</em></strong></blockquote><blockquote><strong><em>System.Threading.Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetAnonymous());</em></strong></blockquote><blockquote><em>WorkflowClientConnection.Open(“localhost”, builder.ToString());</em></blockquote><blockquote><strong><em>System.Threading.Thread.CurrentPrincipal = savePrincipal;</em></strong></blockquote><blockquote><em>////Do your work</em></blockquote><blockquote><em>WorkflowClientConnection.Close();</em></blockquote><p>After we add code above, we can use API as expected. Credit of this solution come from Chris-L in link <a href="https://community.k2.com/t5/K2-Five/Workflow-Client-5-2-API-dll-fails-to-connect-when-running-in-a/m-p/113307">https://community.k2.com/t5/K2-Five/Workflow-Client-5-2-API-dll-fails-to-connect-when-running-in-a/m-p/113307</a>. From the link, it’s the error in K2 5.2 but in my test is K2 5.3 and still found this error. So if we found the error, use this as temporary solution before we got the official fix.</p><p>I’ve a short update this time. Next blog will talk about K2 design pattern so see you next time :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d03fbd41d9ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-five-workflow-client-api-error-bootstrapcontext-d03fbd41d9ae">K2 Five Workflow.Client API Error: BootstrapContext</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K2 Five 5.3 Google Drive Integration]]></title>
            <link>https://medium.com/k2-dev-en/k2-five-5-3-google-drive-integration-23739b2430c2?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/23739b2430c2</guid>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[google-drive]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 09:55:03 GMT</pubDate>
            <atom:updated>2019-09-16T09:55:03.704Z</atom:updated>
            <content:encoded><![CDATA[<p>When we talk about K2 Five 5.3 release notes on previous blog, we mention that K2 5.3 will have easier integration solution. So I’ll show you in this blog. If you can’t remember how we connect with google drive in previous version, you can recap at <a href="https://k2ranger.wordpress.com/2018/02/09/k2-google-g-suite-integration-en-version/">https://k2ranger.wordpress.com/2018/02/09/k2-google-g-suite-integration-en-version/</a></p><h3>Enable Cloud Storage</h3><p>K2 use service name “cloud storage” to integrate with Google Drive, Box, Dropbox และ OneDrive. So the first step is to enable this service. This service need id and url from our K2 database. After we get id and url, we can open ticket to get script to enable service.</p><p>You can see how to in K2 official help page <a href="https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#ServiceBrokers/CloudStorage/CloudStorage.htm">https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#ServiceBrokers/CloudStorage/CloudStorage.htm</a>. After we get script from K2 support, we need to run script in our K2 database and restart K2 service. Then we’re good to go.</p><h3>Enable Feature</h3><p>Next step is going to K2 Management site. Select “Google Drive” from Features menu and click “New Instance”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRh7oUq0yYKUFCTOIMKMzA.png" /><figcaption>Features</figcaption></figure><p>Named your service instance here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*82qD4qKCkVDOPqkjRXRQLA.png" /><figcaption>Add New Instance</figcaption></figure><p>K2 will open another page to authenticate with Google</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*YLRwca30LmdUh3qq69cGUQ.png" /><figcaption>Signin</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*sJr3zYazqLGihbk7eNzeOw.png" /><figcaption>Password</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*RIcwVk50WHFGWLFIRnz4Cw.png" /><figcaption>2 Step Verification</figcaption></figure><p>After fill in all information, Google will display grant permission dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*db1Jv2Eej6PFAvS57W5SWw.png" /><figcaption>Grant permission</figcaption></figure><p>After Allow we’ll got another summary page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*8FEfKNWdLFLU6vu3ocPF4A.png" /><figcaption>Confirm</figcaption></figure><p>Then we’ll get Authorization Successful message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHm0lVdY9ZWFZe2WHhs2ew.png" /><figcaption>Successful</figcaption></figure><p>After closing Authorization Successful page, we’ll come back to Management Site. If we see below page, configuration is already completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FG68idHzyYgv4b2udd-gBA.png" /><figcaption>Done</figcaption></figure><p>We’ll see new service instance that we already created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7NEWaJcWlGHKmztSBSuQQ.png" /><figcaption>Feature Instance Created</figcaption></figure><p>Then we can use this service instance to create SmartObject via SmarObject Service Tester, K2 Designer or generate from K2 Management Site.</p><h3>Testing</h3><p>When we testing with SmartObject, K2 will ask to authentication with Google again. After this round of authentication, you finally get information from Google Drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhLcet1pp6gONqad_UKDjg.png" /><figcaption>Test Search File</figcaption></figure><p>It’s a lot easier than the previous version. For other services (Dropbox, Box and Ondrive) will be the same. So you can try that out by yourself :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23739b2430c2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-five-5-3-google-drive-integration-23739b2430c2">K2 Five 5.3 Google Drive Integration</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[K2 Package and Deployment] — Deploy with PowerShell]]></title>
            <link>https://medium.com/k2-dev-en/k2-package-and-deployment-deploy-with-powershell-47245843b2d0?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/47245843b2d0</guid>
            <category><![CDATA[k2]]></category>
            <category><![CDATA[package-and-deployment]]></category>
            <category><![CDATA[k2-blackpearl]]></category>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Thu, 18 Jul 2019 13:11:55 GMT</pubDate>
            <atom:updated>2024-07-10T01:49:06.549Z</atom:updated>
            <content:encoded><![CDATA[<h3>[K2 Package and Deployment] — Deploy with PowerShell</h3><p>I’ve a question from customer few days agos about deploy K2 package with script. If you see in official guide (<a href="https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#PackageAndDeploy/Powershell-Automated-Deployment.html%3FTocPath%3DCreate%7CDeploying%2520K2%2520applications%7CDeploying%2520a%2520Package%7C_____5">https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#PackageAndDeploy/Powershell-Automated-Deployment.html%3FTocPath%3DCreate%7CDeploying%2520K2%2520applications%7CDeploying%2520a%2520Package%7C_____5</a>), you will find some instructions but not too detail. So in this blog I’ll provide step by step to deploy package using script (PowerShell)</p><h3>Create Package</h3><p>Before we deploy, we need to create package. The package I use was Form, View, SmartObject and Workflow using Service Instance that connect to SQL database. All objects as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9ByXHs73tWbG0SIHyi91w.png" /><figcaption>Object in package</figcaption></figure><h3>Create Deployment Configuration File</h3><p>After we got package file, we need to open Windows PowerShell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pEoGJX0mUctge7GLfdtx_g.png" /><figcaption>Open Windows PowerShell</figcaption></figure><p>Input below command to add package and deployment snapin to PowerShell.</p><blockquote>add-pssnapin SourceCode.Deployment.PowerShell</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4JJiwRQUawH4QLjgrtUrqw.png" /><figcaption>Run Add PowerShell Snapin</figcaption></figure><p>Using below command to generate XML Configuration File for our package. Recommend to use same file name as our package name.</p><blockquote>Write-DeploymentConfig ‘{Path}\Package Name.kspx’ -OutputFile ‘{Path}\Package Name.xml’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDxGq-OE1T_QPVdOaPoWiA.png" /><figcaption>Run to Create XML Configuration File</figcaption></figure><p>Open Configuration File to see the default setting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJuaKXUijLHWRtKXEgrS7Q.png" /><figcaption>Configuration File</figcaption></figure><p>Section that we focus is SpecificOptions tag. Under this tag is the list of object that we have in package. Action that we can use as below</p><ul><li>Default =&gt; Use default action that package and deployment analyst for us</li><li>Deploy =&gt; Deploy this object</li><li>Exclude =&gt; Not deploy this object</li><li>UseExisting =&gt; Use object that exist on target environment. We always use this option with Service Instance.</li></ul><p>In general, we don’t need to change configuration that package deployment tool generate for us. If we use Default, package and deployment will automatically select appropriate action for us. We’ll change to Deploy option in case that we want to make sure that object will deployed to target environment.</p><h3>Deploy Package</h3><p>Before we deploy, we need to check object that not include in package and deployment tool. List of objects as below (reference: <a href="https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#PackageAndDeploy/PandD-Considerations.htm%3FTocPath%3DCreate%7CDeploying%2520K2%2520applications%7C_____4">https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#PackageAndDeploy/PandD-Considerations.htm%3FTocPath%3DCreate%7CDeploying%2520K2%2520applications%7C_____4</a>)</p><ul><li>SharePoint objects (list, libraries, field, columns, content types and items in list or libraries) — <strong>Update</strong> in later version there is a note indicate that SharePoint object is not available to deploy with PowerShell. Need to deploy with K2 Package and Deployment tool only.</li><li>Database and object in database (table, view, stored procedure)</li><li>Web services or dll that we need to reference</li><li>Custom configuration in file configure (K2HostServer.exe.config)</li><li>Service Instance</li></ul><p>After we already checked, we’ll proceed to deployment. Before we deploy, I’ve delete the object that I already packed so we can check that our deployment was success. Command to deploy will be</p><blockquote>Deploy-Package -FileName ‘{Path}\Package Name.kspx’ -ConfigFile ‘{Path}\Package Name.XML’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wy8tAhIzN2DNwybR_KtD3w.png" /><figcaption>Successful Deployment</figcaption></figure><p>After deploy, we need to check the result and it was successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*fvoINz57a8CRIHVZz-IMLA.png" /><figcaption>Check Result</figcaption></figure><h3>Deploy with Different Service Instance Name</h3><p>In real word, sometimes we create Service Instance with different name in different environment. If we deploy using UI, we have option to select existing Service Instance. In command, we’ve the same functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*yhobGNwR3wwTyMAbRLYS0Q.png" /><figcaption>Different Service Instance Name</figcaption></figure><p>In my example, I create SmartObject reference with EmployeeOnboarding Service Instance. But in target environment, we create Service Instance as NewEmployeeOnboarding.</p><p>What we have to add in Configuration File is adding tag targetName to specify new service instance name and targetNamespace to specify namespace of new service instance. In fact, targetNamespace was the same as our old service instance, but we need to add in otherwise we’ll got error when deploy.</p><p>So I we want to change EmployeeOnboarding to NewEmployeeOnboarding we need to add tag as below</p><blockquote>&lt;resolve name=”EmployeeOnboarding” namespace=”urn:SourceCode/SmartObjects/ServiceInstance” action=”UseExisting” <strong>targetName=”NewEmployeeOnboarding” <br>targetNamespace=”urn:SourceCode/SmartObjects/ServiceInstance”</strong> /&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pn16Qzxa5gKbfNBDfK8woA.png" /><figcaption>Change Service Instance Name</figcaption></figure><p>After modify Configuration File, we deploy again (and yes!!! I delete object before deploy again). When command run success, we’ll check our SmartObject and it change to use our new Service Instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*QQSLxMtrcpB8hLfBtFUH6Q.png" /><figcaption>SMO Use New Service Instance</figcaption></figure><h3>Summary</h3><p>When we want to deploy package to another environment, what we need to do is deployment guide. Deployment with PowerShell will reduce time that we used to create deployment guide. If our organization using automate deployment tools, we can adapt PowerShell command with a tool. Our life would be a little bit easier. It’s all for this time :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47245843b2d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-package-and-deployment-deploy-with-powershell-47245843b2d0">[K2 Package and Deployment] — Deploy with PowerShell</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K2 Five 5.3 [What Release Notes Not Telling You]]]></title>
            <link>https://medium.com/k2-dev-en/k2-five-5-3-what-release-notes-not-telling-you-f6557a89d593?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/f6557a89d593</guid>
            <category><![CDATA[k2]]></category>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[release-notes]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Wed, 29 May 2019 16:02:59 GMT</pubDate>
            <atom:updated>2019-05-29T16:02:59.785Z</atom:updated>
            <content:encoded><![CDATA[<p>After I have a chance to use K2 5.3, I found some features that release notes didn’t mentioned. But these features was very useful to developer so I want to talk about these features in this blog.</p><h3>List View Column</h3><p>Finally, time has come. The day that you need to guess number of width that you will get after drag list view column was gone. We can input column width both in list view and table cell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*we42yOxKkV7siSqfRg_TOw.png" /><figcaption>Column Width</figcaption></figure><h3>Style</h3><p>Some case we want to show text in various size. Most of control have style for you so you don’t need to change text size in format menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*pvc00hmZx8Lxb2twK9klfw.png" /><figcaption>Style</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*7F-GOucgDxbC3e_P2uvr6A.png" /><figcaption>Style Sample</figcaption></figure><h3>Workflow’s Task Reminder</h3><p>If you can remember, in the old workflow version. We can configure notification (in old version we call “Escalation”) that tie with working hour. After K2 Five change workflow engine, Escalation transform to Reminder and feature of notify using working hour was missing. But it’s back on K2 5.3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNyqOO3NrDbg6R9wki1cLQ.png" /><figcaption>Task’s Reminder</figcaption></figure><h3>Workflow’s Task Due Date</h3><p>We can configure task’s due date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JfvSQQAFUbffju6nB5d_w.png" /><figcaption>Task’s Due Date</figcaption></figure><p>We can configure to show due date in K2 worklist control. This due date is different from task’s deadline because it’s only information. If we compare to old workflow version, due date is activity’s expected duration that we have option to show in worklist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DuoT948QUwD37nFAWFDoRg.png" /><figcaption>Due Date in Worklist Control</figcaption></figure><h3>Summary</h3><p>After reading, I think it’ll help you to consider upgrading to K2 5.3. If you have other features that not in release notes, you can share with me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6557a89d593" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-five-5-3-what-release-notes-not-telling-you-f6557a89d593">K2 Five 5.3 [What Release Notes Not Telling You]</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K2 Process Instance Removal Tool]]></title>
            <link>https://medium.com/k2-dev-en/k2-process-instance-removal-tool-6bf5e84189d?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/6bf5e84189d</guid>
            <category><![CDATA[k2]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[k2-blackpearl]]></category>
            <category><![CDATA[process-instance]]></category>
            <category><![CDATA[k2-five]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Wed, 03 Apr 2019 04:42:20 GMT</pubDate>
            <atom:updated>2019-04-03T04:42:20.159Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve a question from our customer about delete process instance from server in bulk. If we use process instance management in K2 Management site, we can delete only 20 items and we need to select the process that we want to delete. If we want to delete many processes, it’ll take a lot of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIl-EbI3SA5cGTR4sRucCQ.png" /><figcaption>Process Instance Management in Management Site</figcaption></figure><h3>How To Do?</h3><p>If we want to do bulk delete, how do we do?</p><p>The easiest way is delete record in table Server.ProcInst but this way record in related tables will not deleted. So we didn’t recommend this way.</p><p>Recommended way was delete record in related tables then delete record in Server.ProcInst but it’s hard to delete in all related tables. So we’ll do with API.</p><h3>Solution in API</h3><p>Firstly, how we can get all process instance? For this question, we have “Process Instance” SmartObject that K2 provide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-VGgwED6E9OxtxHsMqgJA.png" /><figcaption>Process Instance SmartObject</figcaption></figure><p>We’ll use this SmartObjct to list all process instance that we want to delete. In our case, we’ll filter from process instance’s start date and process instance’s status. Coding that we’ll use will be below.</p><blockquote>SourceCode.Data.SmartObjectsClient.SOConnectionStringBuilder builder = new SourceCode.Data.SmartObjectsClient.SOConnectionStringBuilder();</blockquote><blockquote>builder.Server = “localhost”;</blockquote><blockquote>builder.Port = 5555;</blockquote><blockquote>DataTable dtProcInst = new DataTable();</blockquote><blockquote>using (SourceCode.Data.SmartObjectsClient.SOConnection con = new SourceCode.Data.SmartObjectsClient.SOConnection(builder.ConnectionString))</blockquote><blockquote>{</blockquote><blockquote>string stmt = @”SELECT * FROM Process_Instance WHERE StartDate BETWEEN @startDate AND @endDate AND Status = ‘“ + status + “‘“;</blockquote><blockquote>SourceCode.Data.SmartObjectsClient.SOCommand command = new SourceCode.Data.SmartObjectsClient.SOCommand(stmt, con);</blockquote><blockquote>try</blockquote><blockquote>{</blockquote><blockquote>con.Open();</blockquote><blockquote>SourceCode.Data.SmartObjectsClient.SODataAdapter adapter = new SourceCode.Data.SmartObjectsClient.SODataAdapter(command);</blockquote><blockquote>command.Parameters.Add(“@startDate”, DbType.DateTime);</blockquote><blockquote>command.Parameters.Add(“@endDate”, DbType.DateTime);</blockquote><blockquote>command.Parameters[“@startDate”].Value = startDate;</blockquote><blockquote>command.Parameters[“@endDate”].Value = endDate;</blockquote><blockquote>adapter.Fill(dtProcInst);</blockquote><blockquote>}</blockquote><blockquote>finally</blockquote><blockquote>{</blockquote><blockquote>con.Close();</blockquote><blockquote>con.Dispose();</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>We’ll have list of process instance that we want to delete and loop to delete process instance using class WorkflowManagementServer.</p><blockquote>SourceCode.Workflow.Management.WorkflowManagementServer wfmServer = new SourceCode.Workflow.Management.WorkflowManagementServer();</blockquote><blockquote>try</blockquote><blockquote>{</blockquote><blockquote>wfmServer.CreateConnection();</blockquote><blockquote>wfmServer.Connection.Open(GetConnectionString());</blockquote><blockquote>for (int i = 0; i &lt; dtProcInst.Rows.Count; i++)</blockquote><blockquote>{</blockquote><blockquote>DataRow dr = dtProcInst.Rows[i];</blockquote><blockquote>AddLog(“ProcInstID : “ + dr[“ProcessInstanceID”].ToString() + “ StartDate: “ + dr[“StartDate”].ToString() + “ Process Name: “ + dr[“ProcessName”].ToString() + “ Folio: “ + dr[“Folio”].ToString());</blockquote><blockquote>wfmServer.DeleteProcessInstances(int.Parse(dr[“ProcessInstanceID”].ToString()), true);</blockquote><blockquote>}</blockquote><blockquote>AddLog(“@@@@@Record Count: “ + dtProcInst.Rows.Count.ToString());</blockquote><blockquote>wfmServer.Connection.Close();</blockquote><blockquote>wfmServer.Connection.Dispose();</blockquote><blockquote>}</blockquote><blockquote>catch (Exception ex)</blockquote><blockquote>{</blockquote><blockquote>AddLog(“Error: “ + ex.Message);</blockquote><blockquote>wfmServer.Connection.Close();</blockquote><blockquote>wfmServer.Connection.Dispose();</blockquote><blockquote>}</blockquote><p>You can create application using code above. If you want ready to use application, you can download at <a href="https://drive.google.com/open?id=1Y9SSDqzZ1iS3UmQpNrSJqVX6g-l8XmJO">https://drive.google.com/open?id=1Y9SSDqzZ1iS3UmQpNrSJqVX6g-l8XmJO</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UtvqI-dCrYs1lINe7yudow.png" /><figcaption>Process Instance Removal Tool</figcaption></figure><p>Application will let you select date range to search with process instance’s start date and process instance’s status. Then we can click “Process” button to delete process instance. Application will write process instance delete log in application’s directory.</p><p>If you have a chance to use application, please give feedback to me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf5e84189d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/k2-process-instance-removal-tool-6bf5e84189d">K2 Process Instance Removal Tool</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task Name and Goto Activity in K2 Five]]></title>
            <link>https://medium.com/k2-dev-en/task-name-and-goto-activity-in-k2-five-91c7dcf9d2bc?source=rss----c9c08bf56301---4</link>
            <guid isPermaLink="false">https://medium.com/p/91c7dcf9d2bc</guid>
            <category><![CDATA[k2-five]]></category>
            <category><![CDATA[k2-blackpearl]]></category>
            <category><![CDATA[go-to-activity]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[k2]]></category>
            <dc:creator><![CDATA[Pattarawat Teparagul]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 07:53:37 GMT</pubDate>
            <atom:updated>2019-03-07T07:53:37.553Z</atom:updated>
            <content:encoded><![CDATA[<p>In K2, we have function to move task to any step. We can move task in 3 ways.</p><p>First way, is using K2 Management Site or K2 Workspace (in K2 blackpearl). We can click “Go To Activity” button in workflow management. After we click “Go To Activity” button, K2 will list step to move task to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tTSCXzz0GAOSA916R3d6Ow.png" /><figcaption>Go To Activity in K2 Management Site</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INfyJpVcQh3dgPpl-Mwt1g.png" /><figcaption>Step to select in Go To Activity</figcaption></figure><p>Second way, we can use API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PhG-r9gBR4qaKSFKp1vVpg.png" /><figcaption>Coding reference from <a href="https://help.k2.com/support-services/kbt154330">https://help.k2.com/support-services/kbt154330</a></figcaption></figure><p>Third way, K2 have SmartObject (just have in K2 Five. If we use K2 blackpearl, we need to create Endpoint Assembly or Endpoint Werservice to link to dll or web service that we created). GoToActivity Service Object can found at K2 Management =&gt; Workflow =&gt; Management =&gt; Management Service. Then you can create SmartObject from that Service Object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*on0bLO2N_r3hvvlbATY9kQ.png" /><figcaption>K2 Management Service Type</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOemu0JRelWur6Zo9ikPuw.png" /><figcaption>Go To Activity Service Object</figcaption></figure><p>For second and third way, parameter that we’ll use 2 parameters. Process Instance ID of process that we want to move task and name of step that we want to move task to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dijej0y0DOiwnkuGHmT8LQ.png" /><figcaption>Go To Activity Parameters</figcaption></figure><h3>The Problem</h3><p>The function usage seem to be simple. Just input id of workflow instance and step to move to. So we’ll try it out.</p><p>First step, open workflow to see name of step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJgDqrPXtuSKFMyiBummPw.png" /><figcaption>Workflow Design</figcaption></figure><p>We’ll try to move task to step “Manager Approval”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lf5B3oTiGP_eFs5V7a-N2w.png" /><figcaption>Error Activity Not Found</figcaption></figure><p>But we got error step not found. Why this happen???</p><h3>Source of Problem</h3><p>If we see the name of step in workflow, K2 keep 2 type of name — System Name and Display Name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjpzkGR3wvf411xA9vaplA.png" /><figcaption>Name and Display Name</figcaption></figure><p>If we use old version of workflow (in K2 blackpearl), we’ll not found this problem because tool (K2 Studio and K2 for Visual Studio) will force us to input unique name of step in each workflow. But in K2 Five, you can use same name of stop in workflow. This name was Display Name in database.</p><h3>Solution</h3><p>We have 2 ways to see System Name of workflow step — see in database and see through SmartObject. In this blog, we’ll use SmartObject way.</p><p>First step, we need to find “Process” SmartObject (You can find in All SmartObjects category that will be in the buttom of SmartObjects Service Tester tool). Select method “List” and search for your workflow. We need to remember “ProcID” to use. If you deploy workflow multiple times, you will have more than one version of workflow so please use “ProcID” of the correct version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVDTDQQjEvWAx3XootSXEA.png" /><figcaption>Process SmartObject</figcaption></figure><p>Next step is finding “Activity” SmartObject (you can find in All SmartObjects same as Process SmartObject). Input “ProcID” that we got from Process SmartObject. We’ll see System Name and Display Name of step in workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5P161y9waBqaoRv4lt_ciw.png" /></figure><p>We’ll use System Name to use in Go To Activity. “Manager Approval” have system name as “Task”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45cK3IebXNbq65nL9h-f_A.png" /><figcaption>Go To Activity Complete</figcaption></figure><p>Finally, we can use Go To Activity as expected :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91c7dcf9d2bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/k2-dev-en/task-name-and-goto-activity-in-k2-five-91c7dcf9d2bc">Task Name and Goto Activity in K2 Five</a> was originally published in <a href="https://medium.com/k2-dev-en">K2 Dev — EN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>