-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
no longer set category job for every element on xml if category was set in config enableCategory #3734
base: main
Are you sure you want to change the base?
no longer set category job for every element on xml if category was set in config enableCategory #3734
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,6 +26,7 @@ | |||||
import org.flowable.common.engine.api.variable.VariableContainer; | ||||||
import org.flowable.job.service.JobService; | ||||||
import org.flowable.job.service.impl.persistence.entity.JobEntity; | ||||||
import org.springframework.util.CollectionUtils; | ||||||
|
||||||
/** | ||||||
* @author Filip Hrisafov | ||||||
|
@@ -62,19 +63,23 @@ protected static JobEntity createJob(VariableContainer variableContainer, BaseEl | |||||
job.setElementName(((CaseElement) baseElement).getName()); | ||||||
} | ||||||
|
||||||
List<ExtensionElement> jobCategoryElements = baseElement.getExtensionElements().get("jobCategory"); | ||||||
if (jobCategoryElements != null && jobCategoryElements.size() > 0) { | ||||||
ExtensionElement jobCategoryElement = jobCategoryElements.get(0); | ||||||
if (StringUtils.isNotEmpty(jobCategoryElement.getElementText())) { | ||||||
Expression categoryExpression = cmmnEngineConfiguration.getExpressionManager().createExpression(jobCategoryElement.getElementText()); | ||||||
Object categoryValue = categoryExpression.getValue(variableContainer); | ||||||
if (categoryValue != null) { | ||||||
job.setCategory(categoryValue.toString()); | ||||||
if(CollectionUtils.isEmpty(cmmnEngineConfiguration.getEnabledJobCategories())){ | ||||||
List<ExtensionElement> jobCategoryElements = baseElement.getExtensionElements().get("jobCategory"); | ||||||
if (jobCategoryElements != null && jobCategoryElements.size() > 0) { | ||||||
ExtensionElement jobCategoryElement = jobCategoryElements.get(0); | ||||||
if (StringUtils.isNotEmpty(jobCategoryElement.getElementText())) { | ||||||
Expression categoryExpression = cmmnEngineConfiguration.getExpressionManager().createExpression(jobCategoryElement.getElementText()); | ||||||
Object categoryValue = categoryExpression.getValue(variableContainer); | ||||||
if (categoryValue != null) { | ||||||
job.setCategory(categoryValue.toString()); | ||||||
} | ||||||
} | ||||||
} | ||||||
}else{ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
String category = cmmnEngineConfiguration.getEnabledJobCategories().get(0); | ||||||
job.setCategory(category); | ||||||
} | ||||||
|
||||||
|
||||||
job.setTenantId(variableContainer.getTenantId()); | ||||||
|
||||||
return job; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,6 +23,7 @@ | |||||
import org.flowable.engine.impl.persistence.entity.ExecutionEntity; | ||||||
import org.flowable.job.service.JobService; | ||||||
import org.flowable.job.service.impl.persistence.entity.JobEntity; | ||||||
import org.springframework.util.CollectionUtils; | ||||||
|
||||||
/** | ||||||
* @author Filip Hrisafov | ||||||
|
@@ -45,18 +46,25 @@ public static JobEntity createJob(ExecutionEntity execution, BaseElement baseEle | |||||
} | ||||||
job.setJobHandlerType(jobHandlerType); | ||||||
|
||||||
List<ExtensionElement> jobCategoryElements = baseElement.getExtensionElements().get("jobCategory"); | ||||||
if (jobCategoryElements != null && jobCategoryElements.size() > 0) { | ||||||
ExtensionElement jobCategoryElement = jobCategoryElements.get(0); | ||||||
if (StringUtils.isNotEmpty(jobCategoryElement.getElementText())) { | ||||||
Expression categoryExpression = processEngineConfiguration.getExpressionManager().createExpression(jobCategoryElement.getElementText()); | ||||||
Object categoryValue = categoryExpression.getValue(execution); | ||||||
if (categoryValue != null) { | ||||||
job.setCategory(categoryValue.toString()); | ||||||
|
||||||
if(CollectionUtils.isEmpty(processEngineConfiguration.getEnabledJobCategories())){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
List<ExtensionElement> jobCategoryElements = baseElement.getExtensionElements().get("jobCategory"); | ||||||
if (jobCategoryElements != null && jobCategoryElements.size() > 0) { | ||||||
ExtensionElement jobCategoryElement = jobCategoryElements.get(0); | ||||||
if (StringUtils.isNotEmpty(jobCategoryElement.getElementText())) { | ||||||
Expression categoryExpression = processEngineConfiguration.getExpressionManager().createExpression(jobCategoryElement.getElementText()); | ||||||
Object categoryValue = categoryExpression.getValue(execution); | ||||||
if (categoryValue != null) { | ||||||
job.setCategory(categoryValue.toString()); | ||||||
} | ||||||
} | ||||||
} | ||||||
}else{ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok I forgot format, hihi There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dbmalkovsky done, pls re-check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tijsrademakers pls review this |
||||||
String category = processEngineConfiguration.getEnabledJobCategories().get(0); | ||||||
job.setCategory(category); | ||||||
} | ||||||
|
||||||
|
||||||
// Inherit tenant id (if applicable) | ||||||
if (execution.getTenantId() != null) { | ||||||
job.setTenantId(execution.getTenantId()); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project standards are to use spaces