Functions List
From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS
<keywords content="keywords">setEvent, CHelper, suspendprocess, resumeprocess, newcase, getsubprocessid, abortprocess, getassignedworkitems, functions, CMailer, sendEmail, trace</keywords>
Bizagi Functions Related to Processes
The options that define the behavior of the parent process and sub-processes for the functions that suspend or reactivate a process are the following:
- EProcessSuspendResumeOptions.OnlyProcess: Suspends or reactivates the process and its sub-processes.
- EProcessSuspendResumeOptions.ProcessAndParentProcess: Suspends or reactivates the process and its subprocesses and the parent process and its sub-processes, which can also be defined as the “siblings” of the process that is being suspended or reactivated.
- EProcessSuspendResumeOptions.NotProcessAndParentProcess: Suspends or reactivates the parent process and its sub-processes, specifically, the “siblings” of the process that is being suspended or reactivated, but not the process itself.
CHelper.suspendProcess
This function suspends a process.
Input Parameters:
Me: Activity Context
iCaseId: you go of the case to suspend
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
Ejemplo: CHelper.suspendProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess, 7); |
CHelper.suspendProcess
This function suspends a process and notifies the processes, currently and previously assigned, about the suspension.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be suspended
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
iTemplateId: Notification Template Id.
Ejemplo: CHelper.suspendProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess, 7); |
CHelper.suspendProcess
This function suspends a process and notifies the processes currently and previously assigned about the suspension. The value specified for the template and the entity is used for the notification.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be suspended
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
iTemplateId: Notification Template Id.
sRootEntityName: Name of the contextual entity used to solve the template.
oSurrogateKey: Key value of the contextual entity.
Ejemplo: CHelper.suspendProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess, 7);
|
CHelper.resumeProcess
This function reactivates a suspended process.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be reactivated.
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
Example: CHelper.resumeProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess); |
CHelper.resumeProcess
This function reactivates a process and notifies the processes currently and previously assigned about the reactivation.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be reactivated.
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
iTemplateId: Notification Template Id.
Example: CHelper.resumeProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess, 7); |
CHelper.resumeProcess
This function reactivates a process and notifies the processes currently and previously assigned about the suspension. The value specified for the template and the entity is used for the notification.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be reactivated.
eSuspendResumeOptions: This parameter must correspond to one of the values of the options defined above.
iTemplateId: Notification Template Id.
sRootEntityName: Name of the contextual entity used to solve the template.
oSurrogateKey: Key value of the contextual entity.
Example: CHelper.resumeProcess(Me, 7700, EProcessSuspendResumeOptions.OnlyProcess, 7); |
CHelper.NewCase
This function creates a new case of the specified type and returns the application’s entity of the new case.
Input Parameters:
Me: Activity Context
idWFClass: Class Id of the workflow to be created.
Example: var appEnt = CHelper.NewCase(Me, 7); |
CHelper.NewCase
This function creates a new case of the specified type. The creator of the case corresponds to the specified user. This function also returns the application’s entity of the new case.
Input Parameters:
to idUser: Case creator’s User Id.
idWFClass: Class Id of the workflow to be created.
Example: var appEnt = CHelper.NewCase(70, 7); |
CHelper.NewCase
This function creates a new case based on the information provided in the input parameter (string XML). In the input parameter is possible to include data about the creator and business information for the case. For instance, you can create a case of a Update Customer process and send information about the client and this information will be showed in the case.
This function also returns a string with the information about the state of the case like errors during the creation, activities, events and other information.
The schema of the input and output parameters can be found in this link.
Input Parameters:
Xml string : Is possible to create the string in the expression like in the next example :
CHelper.getSubProcessesId
This function returns a set with the sub-processes’ ids of the current case.
Input Parameters:
Me: Entity context
Example: var alSubProcs = CHelper.getSubProcessesId(Me); for (var idSubProc in alSubProcs) { CHelper.abortProcess(Me, idSubProc, EProcessAbortOptions.OnlyProcess); } |
CHelper.getSubProcessesId
This function returns a set with the sub-processes’ ids of the current case, which belong to the class of workflow specified.
Input Parameters:
Me: Context of the organization
sWfClassName: Workflow class name of the sub-processes to be obtained.
Example: var alSubProcs = CHelper.getSubProcessesId(Me, "Credit"); for (var idSubProc in alSubProcs) { CHelper.abortProcess(Me, idSubProc, EProcessAbortOptions.OnlyProcess); } |
CHelper.getSubProcessesId
This function returns a set with the sub-processes’ ids of the current case, which belong to the class of workflow specified.
Input Parameters:
Me: Entity context
iWfClassId: Workflow class id of the sub-processes to be obtained.
Example: var alSubProcs = CHelper.getSubProcessesId(Me, 747); for (var idSubProc in alSubProcs) { CHelper.abortProcess(Me, idSubProc, EProcessAbortOptions.OnlyProcess); } |
CHelper.abortProcess
Abort the specified case. Aborting a case consists of closing the case with aborted status.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be aborted.
eAbortOptions: This parameter must correspond to one of the following options:
- EProcessAbortOptions.OnlyProcess: Aborts the process and its subprocesses.
- EProcessAbortOptions.ProcessAndParentProcess: Aborts the process and its subprocesses and the parent process and its subprocesses, specifically, the “siblings” of the aborted process.
- EProcessAbortOptions.NotProcessAndParentProcess: Abort the parent process and its subprocesses, specifically, the “siblings” of the aborted process, but not the process itself.
Example: CHelper.abortProcess(Me, 740, EProcessAbortOptions.OnlyProcess); |
CHelper.abortProcess
This function aborts the specified case. Aborting a case consists of closing the case with aborted status.
Input Parameters:
Me: Activity Context
iCaseId: Id of the case to be aborted.
eAbortOptions: This parameter must correspond to one of the following options:
- EProcessAbortOptions.OnlyProcess: Aborts the process and its subprocesses.
- EProcessAbortOptions.ProcessAndParentProcess: Aborts the processes and its subprocesses and the parent process and its subprocesses, specifically, the “siblings” of the aborted process, but not the process itself.
- EProcessAbortOptions.NotProcessAndParentProcess: Aborts the parent process and its subprocesses, specifically, specifically, the “siblings” of the aborted process.
- sAbortReason: Reason for which the process is aborted
Ejemplo: CHelper.abortProcess(Me, 740, EProcessAbortOptions.OnlyProcess, "This case is the result of a failure of the external system"); |
CHelper.getAssignedWorkItems
This function returns a set with work items of the specified case, which are assigned to the specified user.
Input Parameters:
Me: Activity Context.
iCaseId: Case Id.
iCurrAssigneeId: User Id.
bIncludeSubProcs: Determines whether the activities found within the case’s sub-processes are included in the results.
Example: var alWorkItems = CHelper.getAssignedWorkItems(Me, 7447, 157, true); for (var workItem in alWorkItems) { trace("test-001", workItem.Name); } |
Trace: CHelper.trace
Trace is a Bizagi function that allows the user to determine the value of a variable or attribute used in a rule at a specific point in time. This function is included in the business rules and generates a .txt file with the name and the value of the variable or attribute indicated in the function.
The function receives two string-type parameters:
CHelper.trace(“File Name”, “Attributes or variables”);
Example: If you would like to know the value of the idClient attribute and the NoLoansRequested variable at a given time: CHelper.trace(“RuleX”, “idClient “ + <idRequest.idClient> + “No Loans “ + NoLoansRequested); |
The Location on the Application Server of the file that is generated wirh the trace function is:
C:\Bizagi\Xpress\Projects\"Name of the Project"\Trace
Note: DO NOT USE THE EXPRESSION trace("FileName","Attribute"). Always user CHelper.trace("FileName","Attribute") |
Bizagi functions Regarding Notifications
CMailer.sendEmail
This function sends a notification by using the specified template.
It is not recommended to use this feature unless the project has been built in a version prior to 9.1. Instead use the e-Mail Message function in the Actionts tab of each activiy.
Input Parameters:
sMail: Recipient’s email address.
iTemplateId: Message’s template id .
sEntityName: Contextual entity for the template’s resolution.
iEntityKey: Key value of the contextual entity.
Example: var Mail = <idRequest.idApplicant.email>; CMailer.sendEmail(Mail, 19, "Pick up", Me.Case.Id); |
Note: The previous use of the CMailer.sendEmail function corresponds to the call used by processes without scopes (Bizagi 8.x). For processes with scopes (Bizagi 9.x), the call must be replaced of the following way: |
CMailer.sendEmail
This function sends a notification by using the specified template.
It is not recommended to use this feature unless the project has been built in a version prior to 9.1. Instead use the e-Mail Message function in the Actions tab of each activiy.
Input Parameters:
sMail: Recipient’s email address.
iTemplateId: Message’s template id.
xPath: Path (xPath) from the rule’s entity context that calls the function to the template’s entity context. If both contexts are equal, then this parameter corresponds to an empty chain.
Me: Activity Context.
Example:var Mail = <idRequest.idApplicant.email>; CMailer.sendEmail(Mail, 19, "idSRequest", Me); |
Bizagi Functions Related to Actions
setEvent
This function triggers the execution of an event within the process.
It is not recommended to use this feature unless the project has been built in a version prior to 9.1
Input Parameters:
Me: Activity Context
iCaseId: Case Id where the event to be triggered is found.
sEventName: Name of the task (event) to be triggered
htProperties: null
Example: setEvent (Me, 7700, “DocumentReceived”, null);
|
setEvent
This function triggers the execution of an event within the process.
It is not recommended to use this feature unless the project has been built in a version prior to 9.1
Input Parameters:
Me: Activity Context
iCaseId: Case Id where the event to be triggered is found.
iEventTaskId: Event Task Id.
htProperties: null
Example: setEvent (Me, 7700, 77, null); |
<comments />