[Minor] Don't lock Resource in SimplePlanning if not set on Action
This commit is contained in:
parent
c2ddc0c7ab
commit
bf0b4e152e
|
@ -19,8 +19,12 @@ public class SimplePlanning extends PlanningPolicy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Resource evaluateAndSetResource(Action action) {
|
public Resource evaluateAndSetResource(Action action) {
|
||||||
tx().lock(Resource.locatorFor(action.getResourceType(), action.getResourceId()));
|
if (action.hasResourceDefined()) {
|
||||||
return tx().getResourceBy(action.getResourceType(), action.getResourceId());
|
tx().lock(action.getResourceLocator());
|
||||||
|
return tx().getResourceBy(action.getResourceType(), action.getResourceId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue