KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Aborting process by name
PRODUCT: 4D | VERSION: 17 R4 | PLATFORM: Mac & Win
Published On: April 11, 2019
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Here is a utility method to abort a process by name:

//---------------------------------------------------------------------------------
// Name: ABORT_PROCESS_BY_NAME
// Description: Method will abort the process by name
//
// Parameters:
// $1 (TEXT) - Process Name
// --------------------------------------------------------------------------------
C_TEXT($1;$processName)
C_LONGINT($i;$ID)
C_COLLECTION($activity)

$processName:=$1
$activity:=Get process activity(Processes only).processes.query("name =:1";$processName)

If ($activity.length>0)
 $ID:=$activity[0].ID

 If ($ID>0) // Processes that are not internal processes
   ABORT PROCESS BY ID($ID)
 End if
End If


Here is an example of aborting the process by name:




Here is running the method:

ABORT_PROCESS_BY_NAME ("Method_Process")


The result of the process aborted:




See Also: