Categories
Bizagi Connector Tips and Tricks

Tips for Building a Connector

Available Data Types

Categories
API Bizagi

Working with Bizagi APIs

Authentication

Go to OAuth2 Applications option under the Admin>Security and register a new application:

Create the Authorization Token

With the Client Id and Client Secret, go to base64encode.org and encode the following: ClientId:ClientSecret.

Set up Postman

POST: {{projectURL}}/oauth2/server/token

For the Authorization header parameter use the following structure: Basic {{the encode ClientId:ClientSecret from the above step}}

Body > raw > JSON: grant_type=client_credentials&scope=api

The result:

Endpoints

General use

GET odata/data/stakeholders
Lists the name of Stakeholders in your project.

GET /odata/data/userProfile
Obtains information regarding the authenticated user.

GET /odata/Image
Obtains detail of an image (base 64).

GET /odata/data/searchByCaseNumber(caseNumber='[id_case]’)
Obtains detail for a given case number.

GET /odata/data/queries
Lists all query forms in your project

GET /odata/data/entities
Lists all manageable entities (parameter entities and stakeholders)

My stuff

GET /odata/data/stuff
Lists all collections set as my stuff (applicable to a Stakeholder, starting from this resource).

GET /odata/data/stuff([id_stuff])
Obtains information of a given collection set of my stuff.

GET /odata/data/stuff([id_stuff])/actions
Lists all actions available for a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/actions([id_action])
Obtains specific information of a given action available for a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values
Obtains all records of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])
Obtains a given record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/actions
Lists all actions available for a given record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/actions([id_action])
Obtains specific information of a given action available for a record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/actions([id_action])/relatedEntities
Lists all attributes which are related entities needed to fire an action (of a given record of a given collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/actions([id_action])/relatedEntities([id_related])
Obtains a given attribute which is a related entity needed to fire an action (of a given record of a given collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])
/actions([id_action])/relatedEntities([id_related])/values
Obtains all possible values of a given attribute which is a related entity, needed to fire an action (of a given record of a given collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/actions([id_action])/relatedEntities([id_related])/values([id_value])
Obtains a given value of a given attribute which is a related entity, needed to fire an action (of a given record of a given collection of my stuff).

POST /odata/data/stuff([id_stuff])/values([id_value])/actions([id_action])/execute
Executes an action available for a given record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations
Browses for other attributes whose information need to be drilled down for (for a given record of a given collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down for (for a given record of a given collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity, for a given record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity, for a given record of a given collection of my stuff.

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations
Browses for other attributes whose information need to be drilled down for (for a given related entity attribute of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down for (for a given related entity attribute of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity (for a given related entity attribute of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity (for a given related entity attribute of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations
Browses for other attributes whose information need to be drilled down for (for a given related entity attribute, 2 levels down, of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down for (for a given related entity attribute, 2 levels down, of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity (for a given related entity attribute, 2 levels down, of a given record from a collection of my stuff).

GET /odata/data/stuff([id_stuff])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity (for a given related entity attribute, 2 levels down, of a given record from a collection of my stuff).

Searches

GET /odata/data/searches
Lists all searches (applicable to a Stakeholder, starting from this resource).

GET /odata/data/searches([id_search])
Obtains information of a given search.

GET /odata/data/searches([id_search])/actions
Lists all actions available for a given search.

GET /odata/data/searches([id_search])/actions([id_action])
Obtains information of a given action available for a given search.

POST /odata/data/searches([id_search])/performSearch
Executes a given search.

GET /odata/data/searches([id_search])/relatedEntities
Obtains the set of entities that are specified as Entity parameter type required by the process to start a case.

GET /odata/data/searches([id_search])/relatedEntities([id_related])
Obtains additional information about a specific entity required by a given process as an Entity parameter to start a case.

GET /odata/data/searches([id_search])/relatedEntities([id_related])/values
Obtains the set of possible values of a given entity required by a specific process to star a case.

GET /odata/data/searches([id_search])/relatedEntities([id_related])/values([id_value])
Obtains additional information about a specific value of a given entity required by a specific process to start a case.

GET /odata/data/searches([id_search])/results
Obtains results of a given search, which is executed without sending parameters.

GET /odata/data/searches([id_search])/results([id_result])
Obtains a specific result of a given search, which is executed without sending parameters.

GET /odata/data/searches([id_search])/results([id_result])/actions
Lists all actions available for a given result of a given search executed without sending parameters.

GET /odata/data/searches([id_search])/results([id_result])/actions([id_action])
Obtains a specific action available for a given result of a given search executed without sending parameters.

GET /odata/data/searches([id_search])/results([id_result])/actions([id_action])/relatedEntities
Obtains all possible values of a given attribute which is a related entity, needed to fire an action (available for a given result of a given search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/actions([id_action])/relatedEntities([id_related])
Obtains a given attribute which is a related entity needed to fire an action (available for a given result of a given search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/actions([id_action])/relatedEntities([id_related])/values
Obtains all possible values of a given attribute which is a related entity, needed to fire an action (available for a given result of a given search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/actions([id_action])/relatedEntities([id_related])/values([id_value])
Obtains a specific value of a given attribute which is a related entity, needed to fire an action (available for a given result of a given search executed without sending parameters).

POST /odata/data/searches([id_search])/results([id_result])/actions([id_action])/execute
Executes an action (available for a given result of a given search executed without sending parameters).

GET odata/data/searches([id_search])/results([id_result])/navigations
Browses for other attributes whose information need to be drilled down for a given result of a given search (which is executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down for a given result of a given search (which is executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity, for a given result of a given search (which is executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity, for a given result of a given search (which is executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations
Browses for other attributes whose information need to be drilled down (for a given related entity attribute of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down (for a given related entity attribute of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity (for a given related entity attribute of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity (for a given related entity attribute of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations
Browses for other attributes whose information needs to be drilled down (for a given related entity attribute, 2 levels down, of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])
Browses for a given attribute whose information needs to be drilled down (for a given related entity attribute, 2 levels down, of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values
Obtains all information about a given attribute in a related entity (for a given related entity attribute, 2 levels down, of a given result coming from a search executed without sending parameters).

GET /odata/data/searches([id_search])/results([id_result])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])/navigations([id_navigation])/values([id_value])
Obtains specific information about a given attribute in a related entity (for a given related entity attribute, 2 levels down, of a given result coming from a search executed without sending parameters).

Relevant processes

GET /odata/data/relevants
Lists all relevant processes.

GET /odata/data/relevants([id_relevant])
Obtains information about a given relevant process.

POST /odata/data/relevants([id_relevant])/start
Fires a new case for a relevant process.

GET /odata/data/relevants([id_relevant])/relatedEntities
Lists all attributes which are related entities needed to fire a new case (of a given relevant process).

GET /odata/data/relevants([id_relevant])/relatedEntities([id_related])
Obtains a given attribute which is a related entity needed to fire a new case (of a given relevant process).

GET /odata/data/relevants([id_relevant])/relatedEntities([id_related])/values
Obtains all possible values of a given attribute which is a related entity, needed to fire a new case (of a given relevant process).

GET /odata/data/relevants([id_relevant])/relatedEntities([id_related])/values([id_value])
Obtains a given value of a given attribute which is a related entity, needed to fire a new case (of a given relevant process).

GET /odata/data/relevants([id_relevant])/actions
Lists all actions available for a given relevant process.

GET /odata/data/relevants([id_relevant])/actions([id_action])
Obtains information of a given action available for a given relevant process.

GET /odata/data/relevants([id_relevant])/actions([id_action])/relatedEntities
Lists all attributes which are related entities needed to fire an action (of a given relevant process).

GET /odata/data/relevants([id_relevant])/actions([id_action])/relatedEntities([id_related])
Obtains a given attribute which is a related entity needed to fire an action (of a given relevant process).

GET /odata/data/relevants([id_relevant])/actions([id_action])/relatedEntities([id_related])/values
Obtains all possible values of a given attribute which is a related entity, needed to fire an action (of a given relevant process).

GET /odata/data/relevants([id_relevant])/actions([id_action])/relatedEntities([id_related])/values([id_value])
Obtains a given value of a given attribute which is a related entity, needed to fire an action (of a given relevant process).

Processes

Categories
Bizagi Tips and Tricks

How to update an entity not related to the data model

An easy way to update an entity which is not related to the data model is to use the CEntityManager method called GetEntity. This comes in handy when the SOA layer is not accessible as this is the only way you can perform this operation.

Categories
Best Practices Bizagi

How to Keep Track of Deployments (Bizagi)

Bizagi is a very peculiar tool when it comes to deployments and if you are not well organized, things can go south pretty quickly.

In my current project, the production environment is in use 24/7 and the opportunities for a new release window are slim to none. So, imagine having issues in production just because you forgot to import the values of a new parameter entity.

Categories
Bizagi Tips and Tricks

Date, DateTime data types

Convert Date or DateTime to String data type

var sDateTimeFormatted = dDateTime.ToString("MM/dd/yyyy hh:mm");
var sDateFormatted = dDate.ToString("MM/dd/yyyy");

Or you could use String.Format

var sDateFormatted = System.String.Format("{0:d}",DateTime.Now);

Use this to convert it for XML

var dTransactionDate = DateTime.Now;
var sTransactionDate = XmlConvert.ToString(dTransactionDate, XmlDateTimeSerializationMode.Unspecified);

Dates as filters for entities

[dDateDelivered != null AND dDateDelivered >= '08/22/2019 12:00:00 AM']

Bizagi’s way

<format-date(<XPath>,"format")>
Categories
Bizagi Tips and Tricks

Escape Character in Bizagi

Use backslash (\) for string escape. See the following examples:

var sAttribute = "test";
var xCollection= Me.getXPath("entity-list(\"mEntity\", \"sAttribute = '"+ sAttribute +"' AND bActive = 1\")");
var xCollection= Me.getXPath("entity-list('mEntity','sAttribute = \"test\" ')");
Categories
Bizagi Tips and Tricks

Error Could not generate assembly for

Web portal error in Bizagi

Error Type: BaseException

Error Message: Unable to process control: _. Control type: ContentPanel. Unable to process property: _. Error processing Rule = _; Error: Error Evaluating Rule _ -Error Could not generate assembly for [C:\home\site\wwwroot\App_Data\Temporary\ComponentLibrary\BizAgi.ComponentLibrary.CRuleContextJS.js]: Errors: Error Line,Column:596,26 Error Description: ‘get’ is a new reserved word and should not be used as an identifier

Categories
Best Practices Bizagi Tips and Tricks

Avoid private processes in Bizagi

Why private processes are not good?

I present two important reasons why you should not use private processes within Bizagi:

  1. Reporting Challenges: One significant problem I have encountered is related to reporting. When cases are marked as private, the information displayed in reports depends on the user running the report. If the user has access to the case, the related information will be included in the report. However, if the user does not have access, the information will be excluded. This can create complications when you have a Manager role specifically designated for reporting purposes only. In such cases, the manager needs to be granted permission to view case details in the reports using commands like “CHelper.GrantCaseAccess(Me.Case.Id, iUserId).” But what happens when a new manager is added to the role? Do you have to run the same command for all the existing cases? While it is technically possible, it would be more convenient if this process was simplified.
  2. Access Management Challenges: The second issue with private processes is related to the constant changes in personnel who require access to the cases. As roles change or new people are assigned to a particular role, the access to cases should be dynamic. However, when using private processes, manually managing these access changes can become cumbersome. It becomes necessary to constantly update permissions and ensure that the right individuals have access to the appropriate cases. This can be time-consuming and prone to errors.

Considering these challenges, I strongly recommend avoiding the use of private processes in Bizagi. Instead, it is advisable to explore the following alternative approach that offers more efficient and dynamic ways of managing reporting and access permissions within the system.

What should I use instead?

I strongly recommend utilizing visibility rules on the summary form instead. By implementing simple expressions that evaluate whether a user’s role matches certain criteria, you can determine whether they should have access to the summary page. For example, if a user has the role of Manager, you can allow access to the summary page. On the other hand, if the user has a different role that shouldn’t have access to the case, you can restrict their access.

Visibility rules based on user roles are straightforward to manage and modify in the future if needed. If there are changes to the roles or access requirements, you can easily update the expressions without extensive manual adjustments. This flexibility ensures that the access permissions remain aligned with the evolving needs of your organization.

By utilizing visibility rules, you can simplify the process of controlling access to the summary page in Bizagi. It provides a more efficient and dynamic approach compared to using private processes.

Categories
Bizagi Tips and Tricks

Collections in Bizagi

Case Scenario: The Peer Review process

The Peer Review process in Bizagi

Process Description: The Peer Review process is a collaborative approach that involves two key participants: the Reviewer and the Developer. In this process, the Developer examines and evaluates the code created by the Reviewer. The purpose of this examination is to ensure the code meets certain standards and to identify any potential issues or areas for improvement.

Working with collections

To illustrate how easy is to work with collections I will describe the technical functionalities using the process called Peer Review.

When you must fill in a form and then save the content into a collection I suggest the following solution:

Data model: You have 2 entities Main Process entity called mPER and an entity mPERFinding. The latter has 2 relations with the former: these two are one-to-one (Finding) and one-to-many(Findings) as seen in the picture below.

Data model

The first relation is used to create the form where the user inputs the data.

The second one is to store the data each time the user completes the form.

<mPER.kmPERFinding.mPER> = <mPER>;
Peer Review workflow
Categories
Bizagi Tips and Tricks

How to send emails from an expression

I had situations in the past where I was required to send a notification directly from an expression. After some trial and error, I managed to find a way. Here is an example of how to send a notification directly from an expression. The first thing I did was to create a library rule. The purpose is to have all the code in one place, in case I need to make any changes down the road. Otherwise, I will have to replicate the change in all the expressions where I’ve used the email method.