K2 Memo Line Break

[Origin] http://community.k2.com/t5/K2-blackpearl/Memo-Line-Break/td-p/66586/page/3

Regarding adding a line break to a memo field. I solved a similar problem using just expressions and it is still working under 4.6.11. I used the operators/text/url_decode function. This is intended for decoding url strings (obviously), but seems to work for this situation as well. Example:

2015-12-10 CR expression.png

Advertisements

SmartObjectServiceFunctions – Authentication Failed: The target principal name is incorrect

[Origin] http://community.k2.com/t5/K2-blackpearl/SmartObjectServiceFunctions-Authentication-Failed-The-target/ta-p/87586

Symptoms 

SmartObjectServiceFunctions – Authentication Failed: The target principal name is incorrect

Diagnoses
When you receive an error when trying to Create CRM Entity Item within K2 Studio.

As a result you are unable to connect to the CRM Server despite being able to use the Smart Object Tester to create records using the relevant Smart Object.

Resolution

You can resolve this issue by refreshing the ‘SmartobjectServicefuction’ service instance and service object. After this you should be able to drag in the event to any activity within studio.

Note: use the server tool ‘SmartObjects Service Tester’ to refresh it.

How to Use the K2 Destination Plan per Slot No Destinations rule

From http://blog.velocity-it.com/2015/09/18/how-to-use-the-k2-destination-plan-per-slot-no-destinations-rule/

In this article we will learn how to use one of the K2 blackpearl destination rule – Plan per slot (no destinations).

The K2 blackpearl Plan per slot (no destinations) Destination Rule can be used for activity with server events. K2 User Destinations cannot be configured when plan per slot is used and the server creates one instance per slot. Each instance will have its own activity data fields.

1 - Simple K2 blackparl Workflow process

1 – Simple K2 blackparl Workflow process

By using Plan per slot and SmartObject event we will update all inactive users as active and send a notification. In the below image we can see there are 3 inactive users in table.

2 - K2 Destination Users

2 – K2 Destination Users

Select Destination Rule for activity and run in advanced mode, select plan per slot (no destinations) and destination rule has two options:
1) Can select number of slots to be created (static)

3 - Plan per slot

3 – Plan per slot

2) Number of slots will be created based on the number of records returned by the Smartobject List Method (Dynamic)

4 - Use SmartObject to determine number of slots

4 – Use SmartObject to determine number of slots

In our case, we have selected the EmployeeInfo.List.ID list field on the Destination Rule Options page and mapped Active property value as false.
This will create a slot for each inactive users

5 - K2 SmartObject loading destination users

5 – K2 SmartObject loading destination users

In Smartobject Update method Map value for ID as ActivityInstanceDestInstanceData and Active as true.

6 - K2 ActivityInstanceDestinationData

6 – K2 ActivityInstanceDestinationData

7 - Employee Id from ActivityInstanceDestinationData

7 – Employee Id from ActivityInstanceDestinationData

This will update all the Inactive users as active and notify the users.

8 - Notify Active Users Only

8 – Notify Active Users Only

9 - K2 Notifications

9 – K2 Notifications

We can set a Succeeding Rule for activity to check whether all slots of the Activity Instance “Active Datafield” is set to True. Once all the instances complete, the succeeding rule executes and thus process moves to completed state.

10 - K2 succeeding rule

10 – K2 succeeding rule

HOW TO: Send escalation email to only those destination users who have not completed a task

http://old.k2underground.com/blogs/blacktop/archive/2009/04/29/how-to-send-escalation-email-to-only-those-destination-users-who-have-not-completed-a-task.aspx

Scenario:
Let’s say you have a client event assigned to a role containing N people.  The succeeding rule is such that everyone must complete their task before the activity completes.  You want to send a reminder email to only those members of the role who have not completed their task after some amount of time but not bother those who have already completed.
Solution:
You can do this easily!  Follow these simple steps:

  • Configure your client event as usual
  • On the activity, go into advanced mode for the destination rule and make the following changes:
    • Plan per destination | All at once
    • Create a slot for each destination
    • Resolve all roles and groups to users
  • Right-click on your event and set up your email escalation
  • On the Email Settings page, click Specify next to Recipient
  • Open the context browser for the To field, go to the Workflow Context Tab, and drill down into Activity Destination Instance and select the user email

That’s it!  Now only those members of the role who have not completed their task by the escalation time will receive an email.  A key thing to remember here is to use the Activity Destination Instance user and do not just click theDestination box for the To field.  If you click the destination option, an email will be sent to every member of the role, even if they have completed their task.
Keep in mind, the plan all at once option uses more server resources than plan just once, so if the number of slots is large then you probably should not use this technique.

How to simulate for-each loop with K2 workflow?

https://startrule.wordpress.com/2014/07/10/create-a-loop-using-workflow-activities/

CREATE A LOOP USING WORKFLOW ACTIVITIES

Originally posted on the K2 Underground on Fri., Nov. 29, 2013 You’re developing in K2 Studio and need to iterate over some data. This document will show you how to create a loop using workflow activities and events.  Create-a-Loop-Using-Workflow-Activities