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

BXMSDOC-5098: Added Managing Log files chapter in process designer doc #12

Merged
merged 4 commits into from
Apr 9, 2020

Conversation

hmanwani-rh
Copy link
Owner

@hmanwani-rh hmanwani-rh commented Mar 31, 2020

Copy link

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

BTW all of this is true also for other containers than JWS like EAP for example. Do we already have that there? If so, then it would be good to share the content.


You can use the `jbpm-audit` module that provides an event listener and allows you to store the information directly in a database using JPA or Hibernate. The log data is stored as follows:

* Process instance as `processinstancelog`

Choose a reason for hiding this comment

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

Please use ProcessInstanceLog as the name.


|===

* Element instance as `nodeinstancelog`

Choose a reason for hiding this comment

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

NodeInstanceLog

* Variable instance as `variableinstancelog`
+
[id='fields_variableinstancelog_{context}']
.Fields of the variableinstancelog table

Choose a reason for hiding this comment

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

VariableInstanceLog

|End date of a process instance
|Yes

|`processid`

Choose a reason for hiding this comment

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

I would generally go for lower camel case even for the name of the columns as this is how it appears in the code, so here it would be processId for example.

[id='logging-events-database-proc']
= Logging events to database

You can log an event to a database that occurs on runtime in a process instance, element instance or variable instance.

Choose a reason for hiding this comment

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

element instance -> node instance

<groupId>org.jbpm</groupId>
<artifactId>jbpm-audit</artifactId>
<version>6.5.0.Final-redhat-2</version>
</dependency>

Choose a reason for hiding this comment

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

This should be probably moved to the log-process-instance-con.adoc where you speak about You can use the jbpm-audit module that...

And also please as a version just put there either a variable referring to the current version or some kind of placeholder that will just explain that the version a user is currently using should be specified there.

private EntityManagerFactory emf;

private AuditLogService auditLogService;
@PostConstruct

Choose a reason for hiding this comment

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

@PostConstruct is not relevant here as we don't have to use CDI/EJB framework. You can omit it.

org.jbpm.executor.commands.LogCleanupCommand
----

. Click *Add Parameter* if you wish to use the parameters listed above. In the key section, enter a parameter name. In the value section, enter true or false, depending on the desired outcome.

Choose a reason for hiding this comment

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

if you wish to use the parameters listed above
Where are those parameters?

…tent to eap and process designer user stories
@hmanwani-rh
Copy link
Owner Author

BTW all of this is true also for other containers than JWS like EAP for example. Do we already have that there? If so, then it would be good to share the content.

@MarianMacik thanks for providing the comments. I have made the changes as suggested, can you please review and provide your approval.

Copy link

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

Adding @sutaakar to verify some things.

org.jbpm.executor.commands.LogCleanupCommand
----

. Click *Add Parameter* if you wish to use the <<logcleanupcommand_parameters_{context}, parameters>>, enter a parameter in the key section and enter true or false in the value section.

Choose a reason for hiding this comment

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

Not all parameters have true/false as their value. So I would just state here enter the parameter value in the value section or similar.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Made this change

<artifactId>jbpm-audit</artifactId>
<version>{PRODUCT_VERSION_LONG}-redhat-2</version>
</dependency>
----

Choose a reason for hiding this comment

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

This kind of information cannot be really set when installing it on EAP or JWS. It can only be set when running a process engine inside a custom application. So I wouldn't add it into EAP or JWS install guides but probably to the guide which is about running engine as a part of a custom app.

Copy link

Choose a reason for hiding this comment

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

Right, this setup is already available in Kie server.

Choose a reason for hiding this comment

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

Therefore, I would suggest to move this to another chapter, definitely somewhere where we have configuration of jBPM engine as a part of a custom app.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@MarianMacik and @sutaakar, thanks for providing the inputs, I will be moving this section to process engine doc

<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.x</version>
</dependency>

Choose a reason for hiding this comment

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

Same here, this cannot be configured for Business Central or KIE Server.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Moving this section to process engine doc

RuntimeEngine runtime = singletonManager.getRuntimeEngine(EmptyContext.get());
KieSession ksession = runtime.getKieSession();
AuditLoggerFactory.newInstance(Type.JPA, ksession, null);

Choose a reason for hiding this comment

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

This also belongs to an engine section.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Moving to process engine doc

.Procedure
. Map log classes to the data source that enables the data source to accept the log entries.
* On {EAP}, edit the data source properties in the `persistence.xml` file.
[source,code]

Choose a reason for hiding this comment

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

The persistence.xml of KIE Server already contains this so I guess it should be present only in an engine section.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Moving to process engine doc

<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
Copy link

Choose a reason for hiding this comment

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

@MarianMacik This looks like a deprecated configuration. IMHO the hibernate.transaction.jta.platform should be used here.

Choose a reason for hiding this comment

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

+1

<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
Copy link

Choose a reason for hiding this comment

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

Shouldn't we rather set this to false/skip this property?

Choose a reason for hiding this comment

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

+1

xmlns="http://java.sun.com/xml/ns/persistence">

<persistence-unit name="org.jbpm.persistence.jpa">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
Copy link

Choose a reason for hiding this comment

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

We may rather use org.hibernate.jpa.HibernatePersistenceProvider

Choose a reason for hiding this comment

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

+1

@hmanwani-rh hmanwani-rh changed the title BXMSDOC-5098: Added Logging Process Instance chapter in Install and config doc BXMSDOC-5098: Added Managing Log files chapter in process designer doc Apr 7, 2020
|No, it is used with other parameters.

|`EmfName`
|Persistence unit name that is used to perform operation deletion.
Copy link

Choose a reason for hiding this comment

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

I would use .... to perform delete operation.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

[id='clean-log-proc']
= Removing logs from the database

Use `LogCleanupCommand` executor command to clean up the data that is using the database space. The `LogCleanupCommand` consists of logic to automatically clean up all or selected data.
Copy link

Choose a reason for hiding this comment

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

We can use "which" instead of "that".

Use LogCleanupCommand executor command to clean up the data which is using the database space.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

.Procedure
. In {CENTRAL}, go to *Deploy* > *Jobs*.
. Click *New Job*.
. Enter a name, due date and time and following into the *Type* text field.
Copy link

Choose a reason for hiding this comment

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

Just a question:

In this Enter a name, due date and time and following into the Type text field, what is the following? Is it a command that we are including in the Type text field?

Suggestion: Enter a name, due date, time and, the following command into the Type text field.

Copy link
Owner Author

Choose a reason for hiding this comment

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

yes, following is the command.
Have made the suggested change

org.jbpm.executor.commands.LogCleanupCommand
----

. Click *Add Parameter* if you wish to use the <<logcleanupcommand_parameters_{context}, parameters>>, enter a parameter in the key section and enter a parameter value in the value section.
Copy link

Choose a reason for hiding this comment

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

Original: . Click Add Parameter if you wish to use the <<logcleanupcommand_parameters_{context},
Suggestion: . Click Add Parameter if you want to use the <<logcleanupcommand_parameters_{context},

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

* *Per request strategy* allows automatic removal when a request is terminated.
* *Per process instances* are automatically removed when a process instance is mapped to a session that is completed or aborted.

In order to keep track of process instances, {PRODUCT} provides audit data tables. There are two ways to manage and maintain the audit data tables, including cleaning up the jobs <<setup-auto-cleanup-proc, automatically>> and <<manual-cleanup-con, manually>>.
Copy link

Choose a reason for hiding this comment

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

Add "the".
In order to keep the track of process instances,

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

Copy link

@kaldesai kaldesai left a comment

Choose a reason for hiding this comment

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

Hey @hmanwani-rh, I have added minor suggestions. Otherwise looks good to me. Your content is really clean and clear. :)

Copy link

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

Looks good. I agree with moving some of the parts to process engine doc.

@hmanwani-rh
Copy link
Owner Author

Hey @hmanwani-rh, I have added minor suggestions. Otherwise looks good to me. Your content is really clean and clear. :)

Thank you @kaldesai

@hmanwani-rh
Copy link
Owner Author

Looks good. I agree with moving some of the parts to process engine doc.

Thanks Marian, other sections will be tracked for process engine as part of https://issues.redhat.com/browse/BXMSDOC-5704

@hmanwani-rh hmanwani-rh merged commit 5f063f4 into BXMSDOC-5098-master-final Apr 9, 2020
hmanwani-rh pushed a commit that referenced this pull request Dec 1, 2021
* BXMSDOC-8060 Migration of standalone Business Central from Thorntail to EAP Bootable Jar (#11)

* BXMSDOC-8060 initial commit

* Removes internal notes

* Replaces dashes with colons

* Post QA feedback

* BXMSDOC-8312: Add note to enable user and group management (#12)

* BXMSDOC-8312 Adds note to enable user and group management

* Fixes typo

* Update doc-content/enterprise-only/installation/run-dc-standalone-proc.adoc

Incorporating peer review suggestion.

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

* BXMSDOC-8312: Add note to enable user and group management (#12)

* BXMSDOC-8312 Adds note to enable user and group management

* Fixes typo

* Update doc-content/enterprise-only/installation/run-dc-standalone-proc.adoc

Incorporating peer review suggestion.

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>
hmanwani-rh pushed a commit that referenced this pull request Jan 18, 2022
…che#4043)

* BXMSDOC-8312 Adds note to enable user and group management

* Fixes typo

* Update doc-content/enterprise-only/installation/run-dc-standalone-proc.adoc

Incorporating peer review suggestion.

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>

Co-authored-by: emmurphy1 <30830712+emmurphy1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants