Book a Demo

Author Topic: Generating an activity report without lanes and pools - BPMN  (Read 6887 times)

jami

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • ekhm
    • View Profile
Generating an activity report without lanes and pools - BPMN
« on: March 13, 2024, 08:04:44 pm »
Hi, unfortunately I haven't found a solution, that's why I'm writing here.

I was required to generate, based on process models, a process card containing, among others, a list of activities in the process in the form of a table: name, description of the activity, other assigned features.

However, after developing the template, EA generates in the table, in addition to the activities, also tracks and pools, which I do not want to have in this table. When I turn on the filter that skips them, EA skips them so much that the template does not access them in the browser and does not generate activity.

The second requirement concerns the order of activity. We have ZOrder in the database, but can I extract it to generate activities in Word?

How can I solve this? I will be grateful for your tips.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generating an activity report without lanes and pools - BPMN
« Reply #1 on: March 13, 2024, 08:16:31 pm »
The best solution for this type of requirement is to use an SQL fragment.
That allows the finegrained control you want.

Geert

BobM

  • EA User
  • **
  • Posts: 144
  • Karma: +9/-0
    • View Profile
Re: Generating an activity report without lanes and pools - BPMN
« Reply #2 on: March 13, 2024, 09:21:57 pm »
For the second requirement:
IIRC the order of activities when exporting in Word is following the sorting of your in-line formatting




jami

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • ekhm
    • View Profile
Re: Generating an activity report without lanes and pools - BPMN
« Reply #3 on: March 15, 2024, 09:45:59 pm »
Thank you very much for your answer, the SQL query has been prepared, it works in the search engine and in the database, but when placed in the fragment in the template, messages appear regarding either incorrect ' " or "invalid column name 'Activity'" characters.

Do you have any ideas for the above? I tried every way I know :)

Below is the query:

SELECT t_object.Object_ID AS "Numer początkowy",
       t_object.Name AS "'Nazwa",
       t_object.Note AS "Opis",
       t_diagramobjects.Sequence AS "Kolejność"
FROM t_object
JOIN t_diagramobjects ON t_object.Object_ID = t_diagramobjects.Object_ID
WHERE t_object.Object_Type = 'Activity'
  AND t_diagramobjects.Diagram_ID = '38096'
ORDER BY t_diagramobjects.Sequence;

The above query has been pasted into the fragment settings, and the fragment is used in the appropriate template

Fragment:
custom >
{Numer początkowy}
{Nazwa}
{Opis}
{Kolejność}
< custom




Database: PostgreSQL
EA version: 16.1
« Last Edit: March 15, 2024, 09:48:33 pm by jami »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generating an activity report without lanes and pools - BPMN
« Reply #4 on: March 15, 2024, 10:10:07 pm »
The problem is the column alisasses.

EA will convert your query results into an xml string, using the column names as tag names.

Use something that is compatible with xml and contains no spaces

Code: [Select]
SELECT t_object.Object_ID AS Numer,
       t_object.Name AS Nazwa,
       t_object.Note AS Opis,
       t_diagramobjects.Sequence AS Kolejno
FROM t_object
JOIN t_diagramobjects ON t_object.Object_ID = t_diagramobjects.Object_ID
WHERE t_object.Object_Type = 'Activity'
  AND t_diagramobjects.Diagram_ID = '38096'
ORDER BY t_diagramobjects.Sequence;

You should be able to pass the diagram or  diagram owner ID as parameter so you don't have to hardcode it in your query.

Geert

jami

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • ekhm
    • View Profile
Re: Generating an activity report without lanes and pools - BPMN
« Reply #5 on: March 15, 2024, 11:51:27 pm »
Works!  :)
Thank you very much!
Now I will try with what you wrote in terms of pointing to the diagram in the query.

jami

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
  • ekhm
    • View Profile
Re: Generating an activity report without lanes and pools - BPMN
« Reply #6 on: March 18, 2024, 07:40:02 pm »
Can you suggest how to extract a hardcoded diagram from this query and use this query for each diagram that is in the package indicated in ModelDocumet? Just click on it in the template section and insert the snippet there?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generating an activity report without lanes and pools - BPMN
« Reply #7 on: March 18, 2024, 07:53:35 pm »
There are a few macro's you can use in your SQL fragments: https://sparxsystems.com/enterprise_architect_user_guide/16.1/model_publishing/create_a_custom_sql_query.html

In this case you'll want #DIAGRAMID#

Geert