|
35 | 35 | import org.flowable.cmmn.model.PlanItem;
|
36 | 36 | import org.flowable.cmmn.model.RepetitionRule;
|
37 | 37 | import org.flowable.common.engine.api.scope.ScopeTypes;
|
| 38 | +import org.flowable.common.engine.impl.context.Context; |
38 | 39 | import org.flowable.variable.api.persistence.entity.VariableInstance;
|
39 | 40 | import org.flowable.variable.service.VariableServiceConfiguration;
|
| 41 | +import org.flowable.variable.service.impl.persistence.entity.VariableInitializingList; |
40 | 42 | import org.flowable.variable.service.impl.persistence.entity.VariableInstanceEntity;
|
41 | 43 | import org.flowable.variable.service.impl.persistence.entity.VariableScopeImpl;
|
42 | 44 |
|
@@ -77,7 +79,7 @@ public class PlanItemInstanceEntityImpl extends AbstractCmmnEngineVariableScopeE
|
77 | 79 | protected String exitCriterionId;
|
78 | 80 | protected String extraValue;
|
79 | 81 | protected String tenantId = CmmnEngineConfiguration.NO_TENANT_ID;
|
80 |
| - |
| 82 | + protected List<VariableInstanceEntity> queryVariables; |
81 | 83 | // Counts
|
82 | 84 | protected boolean countEnabled;
|
83 | 85 | protected int variableCount;
|
@@ -457,6 +459,7 @@ public void setExtraValue(String extraValue) {
|
457 | 459 | public String getTenantId() {
|
458 | 460 | return tenantId;
|
459 | 461 | }
|
| 462 | + |
460 | 463 | @Override
|
461 | 464 | public void setTenantId(String tenantId) {
|
462 | 465 | this.tenantId = tenantId;
|
@@ -669,6 +672,31 @@ public void setStateChangeUnprocessed(boolean stateChangeUnprocessed) {
|
669 | 672 | this.stateChangeUnprocessed = stateChangeUnprocessed;
|
670 | 673 | }
|
671 | 674 |
|
| 675 | + @Override |
| 676 | + public Map<String, Object> getPlanItemInstanceLocalVariables() { |
| 677 | + Map<String, Object> variables = new HashMap<>(); |
| 678 | + if (queryVariables != null) { |
| 679 | + for (VariableInstance variableInstance : queryVariables) { |
| 680 | + if (variableInstance.getId() != null && variableInstance.getSubScopeId() != null) { |
| 681 | + variables.put(variableInstance.getName(), variableInstance.getValue()); |
| 682 | + } |
| 683 | + } |
| 684 | + } |
| 685 | + return variables; |
| 686 | + } |
| 687 | + |
| 688 | + @Override |
| 689 | + public List<VariableInstanceEntity> getQueryVariables() { |
| 690 | + if (queryVariables == null && Context.getCommandContext() != null) { |
| 691 | + queryVariables = new VariableInitializingList(); |
| 692 | + } |
| 693 | + return queryVariables; |
| 694 | + } |
| 695 | + |
| 696 | + public void setQueryVariables(List<VariableInstanceEntity> queryVariables) { |
| 697 | + this.queryVariables = queryVariables; |
| 698 | + } |
| 699 | + |
672 | 700 | @Override
|
673 | 701 | public String toString() {
|
674 | 702 | StringBuilder stringBuilder = new StringBuilder();
|
|
0 commit comments