The Direct Case Link feature makes it possible to open a case inside the ProcessMaker Web server or ProcessMaker Mobile app through a link. This link can be used in notifications, templates, output documents, links inside Dynaforms or defined and stored in case variables. The Direct Case Link is unique regardless of case status. This means that the link will be generated according to the case status and will open the case in the corresponding task.
PMCaseLink function creates a direct link that redirects the user to a case.
- string caseUID: (Required) The unique ID of the case, which can be found in the following ways:
- string workspace: (Optional) The workspace. If not set, the current workspace where the case is executed will be selected.
- string language: (Optional) The language that the case displays. If not set, the case opens in the default language configured in the user's profile. If the user didn't define a default language or is using the community edition, the default system language is selected (Admin/settings/system/default language).
- string skin: (Optional) The skin name. If not set, the default skin in the
env.inifile configured in the System configuration is selected.
Note: As of ProcessMaker 3.3.7,
@@SYS_SKINuses the default value if it is used in a script task after a timer event. Therefore, the
PMFCaseLink(@@APPLICATION,@@SYS_SYS,@@SYS_LANG,@@SYS_SKIN)generates a link that uses the default skin.
Returns a string if the case link was generated successfully. Otherwise, returns
false if an error ocurred.
The returned value will be a link to open the case:
Direct Case Link Uses
The URL generated by the direct case link function can be used in different cases:
Opening the Link on Mobile Devices
In previous versions, when the direct case link was opened on a mobile device, the link was opened in the device's browser.
As of ProcessMaker 3.2, a special flag can be set in the env.ini configuration file of each workspace or in the ProcessMaker installation to open the link generated by the direct case link function directly in the ProcessMaker mobile application.
Set to flag to 1 to open the case in the ProcessMaker mobile application. Note that the user assigned to the case must be logged in to the mobile app.
In the following example, a task notification has been sent to the next assigned user. The user taps the case link sent in the email notification. Since the device does NOT have a default browser assigned to open the link, a browser has to be selected.
The device will open the browser for a second to verify the flag's value, and then ProcessMaker Mobile will open automatically displaying the case associated with the case link.
redirect_to_mobile flag is set to 0 or not set at all, when the user taps the case link on a mobile device, the case will open in the browser that the user selects.
Please note the following points:
- If the application is not installed on the mobile device and the
redirect_to_mobileflag is set to 1, the case will NOT be opened.
If the case was already routed, or is not assigned to the user logged in to the mobile application, the following alert will be displayed and the case won't be displayed.
If the case is unassigned and the user who is logged in to the mobile application is assigned to the assignment pool, the following screen will be displayed to claim the case.
Example in a Trigger
First, create a new string variable named app_Link to store the link.
Then, create a trigger named Case Link and place the following code:
Place the trigger before Dynaform in the first step of the first task to generate the Direct Case Link.
Create a notification in the first task to notify the next assigned user(s) by email.
Finally, when running a new case, after the first task is routed, an email containing the Direct Case Link will be sent to all the users assigned to the next task.
Open the Case Using the URL
Open the case in your favorite browser using the generated Direct Case Link. This link opens the ProcessMaker interface, including the main menu and the case list (inbox, draft, etc.). The case linked to by the Direct Case Link will be displayed in the central area.
Warning: As of ProcessMaker 3.3.3, in Internet Explorer 11, the link opens only the form in a new tab as it does when opening the cases from the Inbox.
Permissions and Considerations
ProcessMaker Active Session
To open the case linked to by the Direct Case Link, the user needs to be logged into ProcessMaker. Therefore, take into consideration the following situations:
- Case opened in a new tab: If the link is open inside a browser with an active ProcessMaker session, then the case will be opened in a new tab. An active session means that the user has already logged in using the ProcessMaker login screen or the configured SSO.
- The user is not logged in: If the user is not logged into Processmaker, then the Processmaker login page or the Single Sign On Login page is displayed.
Once logged in, ProcessMaker will be automatically redirected to the case.
Case Status and User Permissions
The same Direct Case Link can be used to open the case for the user current assigned to the case, the supervisor or another user that has participated in the case. ProcessMaker will display the case's information depending on the user's permissions and the case status. The possible conditions when opening the case are described as follows:
- The user is not participating in the case: If the user doesn't participate in the case and doesn’t have specific process permissions, generic case information is displayed.
- The user participated in the case and is assigned to a task: If the user is currently assigned to a task, then the browser is automatically redirected to the specific task in the case.
- The user participated in the case but is not currently assigned to the current task/step:
If the user participated in the case and is not assigned to a task, or the case is completed, paused, or deleted, then the summary form of the case is displayed.
- The user participated in the case and is assigned to more than one task: If the user has more than one task in a case in their inbox, the inbox is displayed filtered by the case number to show all the parallel tasks assigned to the user in the same case. The user must select the task to open in the inbox.
Take into consideration the following points:
- A Direct Case Link can be generated in a different language, skin or workspace to the one that was generated.
- If the language parameter was set, the user that receives the Direct Case Link will open ProcessMaker in the language defined in the link, regardless of the profile language.