Categories
Bizagi Tips and Tricks

How to get the case link in Bizagi

In this article, I will walk you through an easy and powerful solution on how to get the case link in Bizagi.

Create a new library rule

Go to Expert > Business Rules, select Library Rules

and create a new library rule

Enter the following details as you see them in the below image

and add one input parameter iCaseId

Open the Expression and paste the following code:

// Author: Valeriu Bosneaga
// Created: 10 Feb 2023
// Description: Get the link for a specific Case Id
// Input: iCaseId
// Output: string
var sRuleName = "ML_GetCaseLink";
LPT.Global_SetTraceLogs(Me,"1",sRuleName,"START---------------------------------");
var sApplicationName = System.Configuration.ConfigurationSettings.AppSettings["APP_NAME"];
var sServerName = System.Configuration.ConfigurationSettings.AppSettings["SERVER_NAME"];
var sProtocol = System.Configuration.ConfigurationSettings.AppSettings["PROTOCOL"];
var sProjectURL = sProtocol +"://"+ sServerName +"/"+ sApplicationName +"/";
var sCaseId = iCaseId;
var sCaseLink = sProjectURL +"LinkRedirect.html?BehaviorCaseLinkInMobile=AlwaysAskAndRemember&urlMobile=bizagi://&urlWeb="+ sProjectURL +"&caseId="+ sCaseId;
LPT.Global_SetTraceLogs(Me,"1",sRuleName,"END  ---------------------------------");

return sCaseLink;

How and where to use the rule

I use this for my customized HTML emails. I call the rule inside an Email event. This allows the receiver to access the case directly from his/her email.