Commit Graph
921 Commits
Author SHA1 Message Date
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux 4bdfb54ffb Fixed: Apache OFBiz unsafe deserialization of XMLRPC arguments (CVE-2020-9496)
(OFBIZ-11716)

Because the 2 xmlrpc related requets in webtools (xmlrpc and ping) are not using
authentication they are vulnerable to unsafe deserialization.

thanks: Alvaro Munoz <pwntester@github.com> from the GitHub Security Lab team
2020-05-19 15:58:06 +02:00
Pierre Smits 6e4fd2968a Improved: descriptions of temporal expression records (OFBIZ-11584) (#64)
* Improved: descriptions of temporal expression records

(OFBIZ-11584)

* Improved: descriptions of temporal expression records

(OFBIZ-11584)
2020-05-17 10:28:15 +02:00
Jacques Le Roux ccabbd8e4e Fixed: Have a service that runs periodically to generate CustomTimePeriod records
(OFBIZ-10905)

Fixes the loading sequence of CommonScheduledServicesDemoData.xml now
ScheduledServicesDemoData.xml in service component
2020-05-16 13:25:17 +02:00
Pawan Verma de07647bfe Improved: Improve logging for services run on global-commit/global-rollback
(OFBIZ-11667)

Thanks: Jacques and Suraj for the review.
2020-05-10 14:06:38 +05:30
Pawan Verma ffe9c46cf0 Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases
(OFBIZ-11618)
2020-04-30 22:00:04 +05:30
Pawan Verma 1b3d3bdf4e Improved: Added support for EntityQuery methods in OFBiz integration tests.
(OFBIZ-11247)

Thanks: Jacques for the review.
2020-04-29 15:28:42 +05:30
Jacques Le Roux ddb8f4273a Improved: replaces module by MODULE everywhere 2020-04-05 19:46:34 +02:00
Nicolas Malin 9a50fa907b Fixed: Refactoring permission model call, alone permission service failed
(OFBIZ-11440)

During refactoring (OFBIZ-7113), the service reader used two different methods to read a
permission service definition if is present alone or in a group. For the alone version a link
was missing between the service and the permission service to resolve correctly the permission.

To solve this problem I reorganized to use only one method to initialize a service model permission.

Other point, an attribute renaming was missed : action -> permissionMainAction, when service permission call was called

Last, these problems weren't detected before due to missing unit test on failure service permission, now cover.
2020-03-04 21:18:30 +01:00
Nicolas Malin dff226ea60 Improved: Refactoring old job process
(OFBIZ-11200)

Before this commit, to purge old job we use the thread job manager to check
if some job need to be run and if the pool is empty, check the old job to purge.

I detected a problem when you have many job's server and more than one pool.
When you have a first pool that run regular job and a second that receive
huge asynchrone services (by persist call), the server who manage the second pool
have rarely the possibility to purge their jobs that, by the way, increase JobSandbox table.

The Server who manage the first pool, call often the purge process, but the table size
generate a long query time to purge few element. Long query time, run often,
this purge process load uselessly the database.

After analyze, I refactoring these following items :

 * When you call JobSandbox table for a purge, use a limit on the query
   with the max thread pool because when you have the database return,
   you purge only with this limit so this help the database to not scan
   the whole table. Other small improvement, do not sort the result
   (no functional gain).

 * Purge by the pool thread is nice, each server can only purge their
   own job (filtered on run_by_instance_id), to help an overloaded server,
   I was rehability purgeOldJobs service that it can run with specific
    parameter to make assistance.

 * Last, all job services are historical on class org.apache.ofbiz.service.ServiceUtil,
   I moved them all in a new dedicate class org.apache.ofbiz.service.job.JobServices
2020-02-22 18:48:32 +01:00
Nicolas Malin 47e689b360 Fixed: Crashed Scheduled jobs are not getting rescheduled with temporal expression
(OFBIZ-11340)

When a OFBiz server are stopped or crashed with job on queued state,
at the start, they are restarted but without information on tempExprId and recurrenceInfoId

This causes a break for recurrence jobs to their planning

Thanks to Mohammed Rehan Khan for this issue and Scott Gray for the review.
2020-02-06 17:02:12 +01:00
Jacques Le Roux 28b658e260 Improved: Equivalent of svn:auto-props properties on the server
(OFBIZ-OFBIZ-11279)

As explained at https://s.apache.org/i86ht

This is needed after b424d2683e
2019-12-19 13:19:59 +01:00
Mathieu Lirzin aae1c8a8f5 Reverted: "Improved: Use ‘depends-on’ attribute instead of “component-load.xml”"
(OFBIZ-11296)

This reverts commit eeabe69813.
2019-12-18 12:09:20 +01:00
Mathieu Lirzin eeabe69813 Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)
We currently have two ways to define component loading order. Either
by using ‘depends-on’ attribute in “component-config.xml” or by adding
a “component-load.xml” file at the root of a component directory.

“depends-on” is more flexible because it handles partial ordering when
“component-load.xml” defines a total order which is not necessarily
meaningful, so it is better to rely only “depends-on”.

This removes the usage of “component-load.xml” to use ‘depends-on’
instead. The dependency declarations correspond to the total ordering
previously defined but will need to be refined in the future to relax
unnecessary dependency declarations.

Only “framework/base/config/component-load.xml” which defines the
top-level directories order (framework, applications, themes and
plugins) is kept.
2019-11-25 15:28:54 +01:00
Mathieu Lirzin 03b69b30a5 Fixed: Fix linting issues
(OFBIZ-11265)
2019-11-08 18:19:51 +01:00
Jacques Le Roux 8aea160e04 Fixed: Getting policy error while editing html text data using cms
(OFBIZ-11265)

Service parameter with allow-html="safe" does not check the OWASP sanitizer flag
ie. enabled or not and perform sanitization which causing policy error while
editing text data

getting following exception error:
"In field [textData] by our input policy, your input has not been accepted for
security reason. Please check and modify accordingly, thanks."

Thanks: Pradeep Choudhary for report and suggestion
2019-11-07 15:46:05 +01:00
Mathieu Lirzin 43c098c648 Improved: Use utilitary ‘OFBizTestCase#getLogin’ in ‘ServicePermissionTests’
(OFBIZ-11262)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869009 13f79535-47bb-0310-9956-ffa450edef68
2019-10-26 16:22:07 +00:00
Gil Portenseigne 41618b1208 Improved: Remove unwanted error log by ‘ServiceSemaphore’ waiting process
(OFBIZ-11204)

This commit rewrites the error handling of the semaphore release/acquire methods
to return a boolean value indicating the result of the action instead of
throwing when waiting timeout is exceeded or if other issue is met. This with
the removal of confusing error log, that are normal and intended ones.

Javadoc has been added with some refactoring in regards to checkstyle rules.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868942 13f79535-47bb-0310-9956-ffa450edef68
2019-10-25 15:24:53 +00:00
Mathieu Lirzin 2c686c4655 Improved: Avoid unecessary breakage in ‘ContainerConfig’
(OFBIZ-11256)

This restores ‘public’ modifiers on fields and move the ‘Property’
inner class back to ‘Configuration’ to avoid breakage of client code
extending the ‘Container’ interface.

In order to smooth the transition towards using getters instead of
direct field accesss, the public modifiers on fields are now marked as
deprecated.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868628 13f79535-47bb-0310-9956-ffa450edef68
2019-10-19 14:27:01 +00:00
Mathieu Lirzin 7e7ccba7b3 Improved: Refactor ‘ContainerConfig’ class
(OFBIZ-11256)

This removes some code duplication, make things immutable and add some javadoc.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868601 13f79535-47bb-0310-9956-ffa450edef68
2019-10-18 19:46:32 +00:00
Jacques Le Roux e27022b5cd Implemented: Providing utilities for integration tests
(OFBIZ-11247)

First step to simply using "userLogin" in tests

Thanks: Mathieu for the idea on dev ML

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868436 13f79535-47bb-0310-9956-ffa450edef68
2019-10-14 09:59:31 +00:00
Jacques Le Roux 28dfdf5c2e Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use 3 try-with-ressource blocks and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866957 13f79535-47bb-0310-9956-ffa450edef68
2019-09-15 06:32:42 +00:00
Jacques Le Roux 73ebcfb095 Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use a try-with-ressource block and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866952 13f79535-47bb-0310-9956-ffa450edef68
2019-09-14 17:11:59 +00:00
Jacques Le Roux ea17f3f006 Improved: Refactor boolean returns from methods
(OFBIZ-10725)

Reverts mistakes made in previous commit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866930 13f79535-47bb-0310-9956-ffa450edef68
2019-09-14 09:25:03 +00:00
Jacques Le Roux 1686f8cb2a Improved: Refactor boolean returns from methods
(OFBIZ-10725)

Stumbled upon it by chance, here are few changes

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866929 13f79535-47bb-0310-9956-ffa450edef68
2019-09-14 09:19:16 +00:00
Mathieu Lirzin 83aad257be Improved: Remove redundant type declarations
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866786 13f79535-47bb-0310-9956-ffa450edef68
2019-09-11 09:20:03 +00:00
Jacques Le Roux 2cbcb3ae5b Improved: Refactoring permission model call
(OFBIZ-7113)

As mentioned by Mathieu on dev ML uses rather a boolean than a token for 
"require-new-transaction" and "return-error-on-failure"
Also some formatting while at it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866589 13f79535-47bb-0310-9956-ffa450edef68
2019-09-08 07:48:40 +00:00
Nicolas Malin 4a697dc744 Improved: Manage itemStatusId and oldItemStatusId on entity-auto engine
(OFBIZ-11183)
Currently the entity auto engine manage the status change operation on an Entity 
during an update, with analyse the field statusId as new status and compare with current
value through StatusValidChange system. If the change is validated, the previous status
is returned in oldStatusId service parameter.

Service definition example :
    <service name=updateRequirement default-entity-name=Requirement engine=entity-auto invoke=update auth=true>
        <description>Update an existing requirement</description>
        <auto-attributes include=pk mode=IN optional=false/>
        <auto-attributes include=nonpk mode=IN optional=true/>
        <attribute name=oldStatusId type=String mode=OUT optional=true/>
    </service>

I extend this process to an other standard status field: itemStatusId and oldItemStatusId, often present on item element
    <service name=updatePicklistItem default-entity-name=PicklistItem engine=entity-auto invoke=update auth=true>
        <description>Update PicklistItem</description>
        <auto-attributes include=pk mode=IN optional=false/>
        <auto-attributes include=nonpk mode=IN optional=true/>
        <attribute name=oldItemStatusId type=String mode=OUT optional=true/>
    </service>

To realize this, I convert all call on statusId and oldStatusId raw naming by a dynamic resolution field name resolution.
Like this the logical for statusId or itemStatusId are exactly the same

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866559 13f79535-47bb-0310-9956-ffa450edef68
2019-09-07 17:06:37 +00:00
Pawan Verma 968515cf07 Add timezone support to recurring job temporal expressions
(OFBIZ-11035)

When try to define a temporal expression for a recurring job where the temporal expression should be evaluated using a timezone other than whatever the default timezone is for the system.

The use case is having a system that runs on UTC time but needs to send a report at 5 pm Pacific Time every day regardless of whether or not daylight savings is in effect.

To do this:

Added a new field to JobSandbox such as recurrenceTimeZone and modified code to use this timeZone if available.

Thanks: Scott Gray for reporting and Nicolas Malin for the review.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866499 13f79535-47bb-0310-9956-ffa450edef68
2019-09-06 05:41:47 +00:00
Jacques Le Roux 7d7a441715 Fixed: Any ecommerce user has the ability to reset anothers password
(including admin) via "Forget Your Password"
(OFBIZ-4361)

Currently, any user (via ecommerce "Forget Your Password") has the ability to 
reset another users password, including "admin" without permission.  
By simply entering "admin" and clicking "Email Password", the following is 
displayed:

The following occurred:
A new password has been created and sent to you. Please check your Email.

This now forces the user of the ERP to change their password.  
It is also possible to generate a dictionary attack against ofbiz because there 
is no capta code required.  This is serious security risk.

I have modified the patch following comments I made in the Jira, notably
  Removed unused Java variables
  Removed a check in LoginEvents::forgotPassword which prevented to show error
    messages
  Changed fr and en SecurityExtPasswordSentToYou 
    + SecurityExtThisEmailIsInResponseToYourRequestToHave labels 
    + template PasswordEmail.ftl
    + loginservices.token_incorrect labels
  Added fr and en SecurityExtIgnoreEmail + SecurityExtLinkOnce labels
  Removed changes in general.properties
  I did not remove the 2 GetSecurityQuestion.ftl files (webpos one was still in)

There is still room for improvement. I'll discuss them on the Jira and dev
ML. But this version is already strong enough to not wait that the patch is 
inapplicable!

Thanks: mz4wheeler (Mike Z) for the Jira, Nicolas Malin for the patch, I guess 
with some Gil's help, and all others for comments and ideas

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866478 13f79535-47bb-0310-9956-ffa450edef68
2019-09-05 15:56:46 +00:00
Nicolas Malin 5fb61ec804 Implemented: Service parameter default-value attribut can support flexible string
(OFBIZ-11180)

When you define a service with default-value, you can't set simple dynamic resolution for the value.
The improvement extend the default-value attribut on service parameter to support the FlexibleStringExpander syntax and realize the expand on service context.

Example :
     <service name=createPicklist default-entity-name=Picklist engine=entity-auto invoke=create auth=true>
        <auto-attributes include=pk mode=OUT optional=false/>
        <auto-attributes include=nonpk mode=IN optional=true/>
        <override name=statusId default-value=PICKLIST_INPUT/>
        <override name=picklistDate default-value=/>
     </service>

Thanks Jacques Le Roux and Swapnil M Mane for the review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866380 13f79535-47bb-0310-9956-ffa450edef68
2019-09-04 12:05:26 +00:00
Nicolas Malin f4aab777a5 Improved: Refactoring permission model call
(OFBIZ-7113)
With the problem to have a permission service not on the same transaction that the related service [1]

I realized the following improvement to
 * unified call evalPermission
 * move all related field for permission service on ModelService to ModelPermission
 * Remove deprecated code
 * add labelized error message  
 * call as same transaction the permission service by defautl with possibility to overide this rule 
 * add new attributes on permission model: require-new-transaction and return-error-on-failure

Thanks to Jacques Leroux for the review


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866137 13f79535-47bb-0310-9956-ffa450edef68
2019-08-30 08:47:48 +00:00
Mathieu Lirzin 1b34cf7982 Improved: Inline ‘UtilValidate#areEqual’
(OFBIZ-11172)

‘Objects#equals’ is already providing the same functionality of ‘null’
safe equality check.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865843 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 12:52:12 +00:00
Mathieu Lirzin cf79277608 Improved: Remove redundant "dtd" directory from classpath
(OFBIZ-11161)

the "dtd" directories are already present as resources distributed
inside OFBiz jar, so there is no need to augment the classpath to find
the XML schema inside those directories.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865796 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 00:29:41 +00:00
Mathieu Lirzin e9a56a78e5 Improved: Inline ‘UtilGenerics#checkList’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863501 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:35:13 +00:00
Mathieu Lirzin 83fd20607b Improved: Inline ‘UtilGenerics#checkMap’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863500 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:32:34 +00:00
Mathieu Lirzin 16ee111ec3 Improved: Deprecate ‘ContainerConfig#getConfiguration(String, String)’
(OFBIZ-11100)

Since there is no global container configuration file anymore this
method should not be used.  It has been superseded by an overload
which do not require to pass the file name of the configuration file.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863020 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:38:51 +00:00
Mathieu Lirzin ffe2e7ffdf Improved: Add missing ‘static’ modifier for private methods
(OFBIZ-11098)

In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860937 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 12:27:40 +00:00
Jacques Le Roux 08f0b84462 Improved: no functional change, adds missing license headers
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860902 13f79535-47bb-0310-9956-ffa450edef68
2019-06-09 13:08:08 +00:00
Mathieu Lirzin 79edce69f8 Improved: ‘ServiceDispatcher’ is not meant to be extended
(OFBIZ-11032)

This makes the ‘ServiceDispatcher’ class final and replaces the
‘protected’ modifier with ‘private’ for all the fields and methods in
this class.

Thanks Girish Vasmatkar, Jacques Le Roux and Suraj Khurana for the
review.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859938 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 10:01:14 +00:00
Jacques Le Roux 2dadaacac8 Fixed: Services allow arbitrary HTML for parameters with allow-html set to "safe"
(OFBIZ-5254)

This was reopened after discussion at 
https://markmail.org/message/jnaitmwahjcjmdn5

This is a new solution which follows the work done with OFBIZ-6669 and OFBIZ-10187
Roughly said, it uses org.owasp.html.PolicyFactory and org.owasp.html.Sanitizers

Thanks: Christoph Neuroth for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859877 13f79535-47bb-0310-9956-ffa450edef68
2019-05-24 13:47:08 +00:00
Mathieu Lirzin b37e315aef Improved: Use the ‘@Override’ annotation
(OFBIZ-10939)

The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.

Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.

Thanks Jacques Le Roux and Swapnil M Mane for acknowledging the commit.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858295 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 19:34:25 +00:00
Mathieu Lirzin 5982be8161 Improved: Remove unnecessary declared exceptions for ‘ContainerException’
(OFBIZ-10938)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857913 13f79535-47bb-0310-9956-ffa450edef68
2019-04-21 14:22:36 +00:00
Mathieu Lirzin 990c8a3aab Improved: Remove redundant specification of type arguments
(OFBIZ-10937)

Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is done in the
declared type.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
2019-04-21 12:49:52 +00:00
Mathieu Lirzin e34434000b Fixed: Remove unnecessary semicolons in Java code (OFBIZ-10936)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857904 13f79535-47bb-0310-9956-ffa450edef68
2019-04-21 10:55:18 +00:00
Scott Gray 9a349c7a99 Fixed: Bug in TemporalExpression MinuteRange and HourRange that can cause a day
or month to be skipped when using next() (OFBIZ-10875)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857382 13f79535-47bb-0310-9956-ffa450edef68
2019-04-12 08:54:27 +00:00
Jacques Le Roux f85a480f01 Improved: Using try-with-resources with File IO Objects.
(OFBIZ-9855)

Uses try with resources for File IO objects like ObjectInputStream and other 
objects. File classes have the AutoCloseable interface.

jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...

All tests pass

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857099 13f79535-47bb-0310-9956-ffa450edef68
2019-04-08 09:17:55 +00:00
Mathieu Lirzin 8700328f09 Fixed: Remove unused type parameters (OFBIZ-10909)
No functional change.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857087 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 22:00:16 +00:00
Scott Gray ddcbb33de8 Implemented: Allow Jobs to specify a priority and be queued accordingly by the
JobPoller so that important jobs can be prioritized over normal jobs, and low 
priority jobs can be left until last. [OFBIZ-10865]

Changes are as follows:
* Add a "priority" field to JobSandbox entity (numeric/Long)
* Add JobPriority constants class containing fields LOW (0), NORMAL (50) and HIGH (100)
* Add getPriority method to the Job interface and implement methods for AbstractJob (returns NORMAL), PersistedServiceJob (returns JobSandbox.priority) and PurgeJob (returns LOW)
* Change the JobPoller executor's queue to use PriorityBlockingQueue (unbounded) instead of LinkedBlockingQueue (bounded)
* Implement custom Comparator for the priority queue to sort by priority descending and then runTime ascending
* Change the poll size per poll to be (queueSize() - queue.size) instead of queue.remainingCapacity() due to the new queue being unbounded
* I've also opted to limit the database poll query to the poll size using maxRows() because it seemed dangerous to me to use an unconstrained query on this table
* Ensured recurring jobs receive the default (NORMAL) priority when being rescheduled so that they're sorted correctly on the next time they show up in the database poll
* Ensured jobs generated at runtime are given a default priority of NORMAL



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857071 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 07:39:47 +00:00
Swapnil Mane 1879270595 Fixed: Missing oldStatusId in error when no status valid change record found
(OFBIZ-10377)

In the case of entity auto service, when an invalid status change is performed, the error message doesn't show the current status of the item from which the user is changing the status.

Thanks:  Lalit Dashora for reporting the issue and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856598 13f79535-47bb-0310-9956-ffa450edef68
2019-03-30 05:45:34 +00:00