A new function StartProcess() has been added in the library ielib.dll version 1.4. We can integrate this function into a conclusion of a Rule.
This function allows to start a process by specifying the name of a document or of a file.
StartProcess(FileName) : Returns a real number greater than 0 that represents the process ID, otherwise the value zero will be returned.
FileName : The name of a document or of a file to display.
Example 1 : From a fact [F1] real type,. we can define a conclusion of a rule with the StartProcess() function to display a JPEG image.
[F1] = StartProcess(" c:\User\John\Images\monimage.jpg ")StartProcess(AppSpecifique, FileName) : To display the file with a specific application. This function returns a real number greater than 0 that represents the process ID, otherwise the value zero will be returned.
AppSpecifique : Specific application name.
FileName : Name of a document or a file.
Example 2 : As example 1, we can define a conclusion of a rule with the StartProcess() function to display a JPEG image, but with a specific application PhotoFiltre.
[F1] = StartProcess( "C:\Program Files\PhotoFiltre\PhotoFiltre.exe", " C:\User\John\Images\myimage.jpg ") We can use StartProcess() with the variables of a fact, the case of the expert system with the variables.
Example 3 : Suppose we had a fact [F2] Boolean with 2 variables:
var1 et
var2 :
The var1 variable contains the path to the Images directory, Var1=" C:\User\John\Documents\Images\ ", the var2 variable contains the name of image, var2= "monimage.jpg ", then we can define a conclusion by concatenating the contained these 2 variables with the operator '+':
[F1] = StartProcess(var1 + var2)Or
[F1] = StartProcess(var1 + "myiamge.jpg") We use the StartProcess() function to display the differences file types (.doc, .pdf, .xls, .xml).
Otherwise, we can display a file programmatically using the event of the conclusion of a rule ConclusionDoneEvent of the KnowledgeBase class. (See an example of using the ConclusionDoneEvent event)