Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBPM-7916 - Stunner BPMN Process Documentation Feature #2363

Merged
merged 7 commits into from Jan 19, 2019

Conversation

tiagodolphine
Copy link
Contributor

@tiagodolphine tiagodolphine commented Dec 21, 2018

Feature to generate BPMN documentation on Stunner.

  • new tab on the designer for documentation (only enabled when documentation is implemented for a domain, for instance on DMN, should not be enabled)
  • all icon for activities, service tasks, and categories were implemented
  • template engine on client side implemented on appformer (JBPM-7916 - Stunner - Process Documentation (Template Engine) appformer#603)
  • svg form of the diagram inserted and redimensioned to fit the documentation
  • the documentation is processed on the respective tab onclick
  • properties of all elements are inserted generically but some of them were filtered (backgroud, dimesion, among others) need to check if all properties being showed for elements are ok
  • printable version of documentation content

OBS missing the unit tests, I'm working on them now.

Related PR kiegroup/appformer#603

@romartin
@LuboTerifaj

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@tiagodolphine
Copy link
Contributor Author

Jenkins retest this

1 similar comment
@tiagodolphine
Copy link
Contributor Author

Jenkins retest this

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

1 similar comment
@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@tiagodolphine
Copy link
Contributor Author

Jenkins retest this

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

Copy link
Contributor

@romartin romartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tiagodolphine

Great job! Although it's still in progress, code and UI are looking good! 👍

For now added some review comments on the code and also found a bug - cannot scroll on the documentation generated for the process inside the mortgages_process project, I think it's just missing the overflow style attribute somewhere... see:

screenshot from 2019-01-08 00-30-29

Thanks!

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@tiagodolphine
Copy link
Contributor Author

Just pushed some more changes, service tasks, and scroll for the documentation panel.

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@romartin
Copy link
Contributor

romartin commented Jan 9, 2019

thanks for the fixes @tiagodolphine , soo... what's still missing in this PR for considering it candidate for merging?

@LuboTerifaj
Copy link
Contributor

Hello @tiagodolphine

Is this PR ready for review? I am asking because, you have mentioned here, that it is WIP. There is also an issue with full downstream build.

Thanks.

@tiagodolphine
Copy link
Contributor Author

Hi @LuboTerifaj it is a WIP, I plan to push some more changes today, I think it is better for you to wait for a deeper review, I mean the idea of this early PR is to allow you to give tome try and some suggestions.
Anyway, I'll let you know when I push these new changes.
Thanks.

@romartin
Copy link
Contributor

Yep agree with @LuboTerifaj , please let us know once you should start the review again @tiagodolphine , thanks guys!!

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

@tiagodolphine tiagodolphine changed the title [DO NOT MERGE] JBPM-7916 - Stunner BPMN Process Documentation Feature JBPM-7916 - Stunner BPMN Process Documentation Feature Jan 16, 2019
@tiagodolphine
Copy link
Contributor Author

Hi @romartin @LuboTerifaj I updated the PR with the last changes, including the template engine was moved to appformer. This is ok to be reviewed.

OBS missing the unit tests, I'm working on them.

Copy link
Contributor

@romartin romartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added a few more review comments @tiagodolphine , anyway looking good!

@@ -39,11 +38,6 @@ public boolean accepts(final ClientSession session) {

@Override
public <T> void execute(final Callback<T> callback) {
//prevents to render selection on canvas
if (getSession() instanceof EditorSession) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need clear selection anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, every time we are generating SVG or any other images, before that we are clearing the selection on canvas, to avoid showing up the Toolbox, but now I centralized it on the CanvasExport, it is better to keep only on one place IMO, see https://github.com/kiegroup/kie-wb-common/pull/2363/files#diff-0121e8ab393e44ea36b71825a5f6b861

@@ -82,11 +82,6 @@ protected void onSaveDiagram(@Observes SaveDiagramSessionCommandExecutedEvent ev

final Metadata diagramMetadata = getCanvasHandler().getDiagram().getMetadata();
if (Objects.equals(diagramMetadata.getCanvasRootUUID(), event.getDiagramUUID())) {

//prevents to render selection on canvas
getSession().getSelectionControl().clearSelection();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need clear selection anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, every time we are generating SVG or any other images, before that we are clearing the selection on canvas, to avoid showing up the Toolbox, but now I centralized it on the CanvasExport, it is better to keep only on one place IMO, see https://github.com/kiegroup/kie-wb-common/pull/2363/files#diff-0121e8ab393e44ea36b71825a5f6b861

{{&icon}}
</th>
<th width="45%">
<b>Name:</b> {{name}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we support i18n on the templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, should we handle internationalization within the documentation? Is this working on the old designer? I mean this is possible to be made but in this way, we should test a lot of scenarios to guarantee it is all internationalized, IMO we can handle on a separate JIRA, this will allow this PR to be merged faster, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well not sure, but I understand that we need i18n. Anyway yeah, we can handle it in a separate JIRA np 👍

<b>Name:</b> {{name}}
</th>
<th width="50%">
<b>Type:</b> {{title}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<thead>
<tr>
<th>#</th>
<th>Name</th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<td>{{pkg}}</td>
</tr>
<tr>
<td><b>Name</b></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<td>{{name}}</td>
</tr>
<tr>
<td><b>Is executable</b></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<td>{{isExecutable}}</td>
</tr>
<tr>
<td><b>Is AdHoc</b></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<p id="processdatatotals">
<ul class="list-group">
<li class="list-group-item">
Variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

<thead>
<tr>
<th colspan="2">Property Name</th>
<th>Property Value</th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

Copy link
Contributor

@romartin romartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tiagodolphine now tested the generated WAR, just found a couple of issues:

  1. When changing between tabs sometimes the is some "refresh" on the page that is appreciable. It always happens I think once selecting a node on the canvas, and then clicking on the Documentation tab. Adding video that shows this.

documentation-refresh-issue.zip

  1. I think it does not make sense, once in the Documentation tab, showing the dock screens (forms, preview, etc), but not sure if it's easy to fix at this point. Anyway, considering we're not going to remove that docks now, two more issues:
  • As the forms properties panel can be opened at same time, it's possible to update some task name, for example, but the documentation is not being updated until switching tabs again
  • It's then missing to show the horizontal overflow, in case both west and east panels are open. See screenshot:

screenshot from 2019-01-17 01-55-49

Thanks!

…e, avoid page flickering when selecting doc tab
@tiagodolphine
Copy link
Contributor Author

hi @romartin about your comments, I applied the fixed below:

  1. fixed, this was caused buy the css loading
    • now when select documentation tab, the docks will be minimized
    • on the changes on the forms this will reprocess and update the documentation
    • horizontal overflow working with a min-width set

Thanks.

@tiagodolphine
Copy link
Contributor Author

Jenkins execute full downstream build

Copy link
Contributor

@romartin romartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @tiagodolphine , it works good and bugs are fixed 👍 Thanks!

@romartin
Copy link
Contributor

Also reported the bug about missing i18n: JBPM-8145

@romartin
Copy link
Contributor

Hey @LuboTerifaj @hasys

It's missing here some QE reivews yet, but @tiagodolphine will be on holidays during next couple of weeks. As far as I know for completing this PR it's missing some unit tests, but it's full feature completed, and due to this feature is not related to any other existing one, probably makes sense, once you give a try to it and ensure it works (I also did), to merge it and let @tiagodolphine complete the unit tests or whatever issue we find when he's back.

Anyway, please give this a try and let's decide on Monday after your feedback. Thanks!!

ederign pushed a commit to kiegroup/appformer that referenced this pull request Jan 19, 2019
Inserting a _template engine_ to run on Client that is based on [Mustache](https://mustache.github.io/) using the implementation for `Javascript` [MustacheJS](https://github.com/janl/mustache.js). The idea is to process text templates on client side now, although it will allow us to keep the same API having an implementation on backend if necessary since there is a Java implementation (https://github.com/spullara/mustache.java).
The template engine is going to be used on Stunner to generate the **Process Documentation**.

Related PR kiegroup/kie-wb-common#2363
@ederign ederign merged commit 540191c into kiegroup:master Jan 19, 2019
@romartin
Copy link
Contributor

Well @ederign just merged... hehe no problem, it was approved by me also.
Sorry @hasys @LuboTerifaj , please feel free to give this feature a try on master when possible, and if you find any bugs or whatever missing, just create new tickets as usually.
Also please @tiagodolphine remember to complete the missing unit tests related to this PR once you're back 👍
Thanks guys!

Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @tiagodolphine

I have found several issues. Please let me know, which make sense so I will report them:

  • There is missing Process Instance Description in process Overview.

  • All properties in Documentation don't contain new line characters when the real properties do.

  • Properties panel is closing with every switch between panels. As it can be seen in comments above, this was implented because of issue:
    "As the forms properties panel can be opened at same time, it's possible to update some task name, for example, but the documentation is not being updated until switching tabs again".
    From my point of view, it would be better to not hide the panel but change view from any selected node to process properties.

  • All nodes in a process Documentation have two "Name" properties.

  • There are missing data assignments in all nodes (the nodes, which are supposed to have them).

  • There is missing ConditionExpression property name (property value is there) in Conditional events.

  • Start events have different properties then intermediate and end events -> start events has additional properties like:
    Min, Max, Mean, Standard Deviation, Time Unit, Distribution Type

  • All tasks have additional properties:
    Min, Max, Mean, Standard Deviation, Time Unit, Distribution Type

  • Sub-processes contains additional properties like:
    Min, Max, Mean, Standard Deviation, Time Unit, Distribution Type, Staff availability, Working Hours, Cost per time unit, Currency, Time Unit, Distribution Type

Thank you!

@romartin
Copy link
Contributor

Hey @LuboTerifaj

Can you please create a new ticket with all the bugs above and assign to @tiagodolphine , no matter if you're not sure about some point.. let's report them all for now 👍

Thanks!

@LuboTerifaj
Copy link
Contributor

Reported issues:
https://issues.jboss.org/browse/JBPM-8169
https://issues.jboss.org/browse/JBPM-8170

@hasys
Copy link
Member

hasys commented Jan 23, 2019

Great job @LuboTerifaj, thank you!

I putted my 2c to JBPM-8169 issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants