Component Library
From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS
<keywords content="keywords">component libraries, component library, component, custom development, excel, pdf, custom component, dll, assembly, assemblies, code, extend, distributed objects, distributed object, broker, broker architecture, connector, jar, ejb, classes, jms, soap, http, https, com, dcom, esb, legacy, core, erp, crm, rest, soap, jdbc, odbc, </keywords>
|
Applies to the ENTERPRISE EDITIONS |
Contents |
Component library
Overview
Bizagi offers an integration layer which allows existing systems (such as ERP, CRM, Core applications, legacy system and the ESB in general), to be integrated into Bizagi as a BPMS corporate solution.
Organizational processes in Bizagi have the option to easily use: an interface wizard for web and rest services invocations (systems on intranet or internet), and a feature called the Component Library for a process-level integration (transactional).
Throughout the Component library, Bizagi provides powerful extensibility options for both the business logic in the processes, and for the integration layer architecture (that is, the possibility to include specific APIs and connectors to external systems, applications or databases).
An example of Component library use oriented towards business logic enhancement, is when we need to consider process logic that implements sophisticated calculations or operations, for instance when performing amortization payments simulators or files manipulation. These operations can be so complex that may involve the use of existing components and APIs.
Regarding component library use for integration purposes, a corporate solution may require relying on components that connect to other systems, mainly legacy, or those which do not have a service-oriented architecture.
How does it work
The Component library acts as a middleware repository of custom-developed components (which can use APIs or connectors).
This component is registered in Bizagi by including its compilation file (either a built .dll or .jar, according to the platform technology in which Bizagi’s processes will be executed).
For .Net-based environments (Bizagi Enterprise .Net edition), components in the Component Library will have a corresponding dll assembly, while for JAVA-based environments (Bizagi JEE edition), a component will have a corresponding jar file.
Once registered in the Component library of a Bizagi project, components’ public methods can be directly invoked from the processes’ business rules (from either synchronous or asynchronous tasks).
What you need to do in Bizagi
To use the Component library feature, these steps are carried out:
1. Build your component (a compiled output)
2. Register the component in the Component Library
3. Create the business rule which invokes the component.
Example
In the following example, we will use the Component Library feature to include a developed component that uses an external API.
We will illustrate this through a sample Credit Request process.
Notice that this is a simplified example, in which we will validate that the Applicant is not reported in a central Black List in the service task called “Verify Blacklist”.
In this service task, we will create a business rules that accesses our developed component to make use of that given API. Through this API, we invoke a method that returns whether or not the applicant's id is listed in the Blacklist (true or false).
This example is illustrated for both the Bizagi Enterprise .Net and JEE edition in the sections below.
Example for Bizagi Enterprise .Net
In this section, we will illustrate how to use the Component library feature for an Enterprise .Net project.
Build your component (a compiled output)
Our first step is to develop the component as a class library project.
In our sample component called “MyCreditBureauComponent”, we make use of a “CreditBureau.dll”, which represents an example API.
Notice we include the reference in our component.
For the Enteprise .Net edition, we build the class library project as a dll assembly.
Notice our component’s namespace is called “MyCreditBureauComponent”, and that our Class is public (called “Class1”). The method we will use in this example is called “IsCustomerInBlackList”.
Register the component in the Component Library
Having built the component’s assembly in our previous step, we will use the “MyCreditBureauComponent.dll” output to register the component in Bizagi’s component library.
To do this, we go to Bizagi Studio’s Tools and add a new component:
We give a name, a display name, and a description to register this component:
Then, we upload the MyCreditBureauComponent.dll assembly and specify the name for this component’s namespace:
Click on Finish.
Given that this component references and uses another class library (the API), we need to register and include this API into our component library as well.
Therefore, we repeat the steps to add a component, but this time we do it for the “CreditBureau.dll” assembly.
Notice that we need to enter explicitly the complete namespace in our CreditBureau API into the Namespace.
Even though we are not going to invoke directly this API from Bizagi’s business rules, we should set this reference as a best practice.
We upload the corresponding assembly and specify a namespace:
In the end, we need to have registered our 2 assemblies as 2 separate components:
Create the business rule which invokes the component
Now that we have registered our component in the Component library, we proceed to create a business rule which invokes the component’s method.
To do this, we go to the Activity Actions view from our process wizard, and select the “Verify black list” service task. We include a business rule in this point in the process:
In the expression, we invoke our MyCreditBureauComponent’s method with the following syntax:
Namespace.Class.Method
Notice that our Class is not defined as a static class, and therefore we can previously create an instance of it, to invoke its methods. In our example, the complete expression invokes the IsCustomerInBlackList method by:
- Sending out the Applicant’s id.
- Storing the method’s result in the CreditRequest.InBlackList Boolean-type attribute.
This is the expression’s content:
var temp = new MyCreditBureauComponent.Class1();
Me.setXPath("CreditRequest.InBlackList", temp.IsCustomerInBlackList(Me.getXPath("CreditRequest.ApplicantId")));
Example for Bizagi Enterprise JEE
In this section, we will illustrate how to use the Component library feature for an Enterprise JEE project.
Build your component (a compiled output)
Our first step is to develop the component as a Java class library project.
In our sample component called “MyCreditBureauComponent”, we make use of a “CreditBureau.jar”, which represent an example API.
We include the .jar into our project library.
For the Enteprise JEE edition, we build the class library project as a jar file.
Notice that our Class is public (called “Class1”). The method we will use in this example is called “IsCustomerInBlackList”.
Register the component in the Component Library
Having built the component’s jar file in our previous step, we will use this output (“MyCreditBureauComponent.jar”) to register the component in Bizagi’s component library.
To do this, we go to Bizagi Studio’s Tools and add a new component:
We give a name, a display name, and a description to register this component:
Then, we upload the MyCreditBureauComponent.jar file.
Notice that we need to enter explicitly the complete package name of our file into the Namespace.
Click on Finish.
Given that this component references and uses another jar library (the API), we need to register and include this API into our component library as well.
Therefore, we repeat the steps to add a component, but this time we do it for the “CreditBureau.jar” reference.
Notice that we need to enter explicitly the complete package name of our CreditBureau API into the Namespace.
Even though we are not going to invoke directly this API from Bizagi’s business rules, we need to set this reference in order for Bizagi to look up the referenced files.
We upload the corresponding jar file:
In the end, we need to have registered our 2 jars as 2 separate components:
Create the business rule which invokes the component
Now that we have registered our component in the Component library, we proceed to create a business rule which invokes the component’s method.
To do this, we go to the Activity Actions view from our process wizard, and select the “Verify black list” service task. We include a business rule in this point in the process:
In the expression, we invoke our MyCreditBureauComponent’s method with the following syntax:
Class.Method
Notice that our Class is not defined as a static class, and therefore we can previously create an instance of it, to invoke its methods. In our example, the complete expression invokes the IsCustomerInBlackList method by:
- Sending out the Applicant’s id.
- Storing the method’s result in the CreditRequest.InBlackList Boolean-type attribute.
This is the expression’s content:
var temp = new Class1();
Me.setXPath("CreditRequest.InBlackList", temp.IsCustomerInBlackList(Me.getXPath("CreditRequest.ApplicantId")));
|
Note: When saving the business rule invoking a Component's method (as in this example), the rule will be saved with warnings and errors shown in Bizagi's compilation. For this case, these messages can be ignored (it will work Ok on execution). |
Result
To see this example working, we execute our process in Bizagi’s work portal by clicking in the “Run process” option:
We can see that after the “Verify black list” service task, our next activity will show the result of our component’s method invocation:
At this point, we are set using a custom developed component with the Component library feature in Bizagi!
Components in Production
Once a project has been deployed to the Production environment, it will not be possible to delete its components (registered in the Component Library).
Therefore, in the development environment (through Bizagi Studio) edition of components’ information is restricted according to whether or not this component is already deployed on a productive environment.
Edition of a deployed component’s information will consider:
- You may edit its registered compilation file (dll assembly or jar file).
- You may not edit the component’s name or its defined namespace in the Component library.
Related Articles
- Using Component Library for SAP integration (example done in .Net).
- Using Component Library to Execute external stored procedures (example done in .Net).
- Using Component Library for Excel integration (example done in .Net).
- Using Component Library to manage and generate documents from dynamic templates (example done in .Net).
<comments />






