Added simple error if node cannot do a action due to ProductTypeOperation restrictions
This commit is contained in:
parent
e25879bcb6
commit
59246406a6
@ -164,7 +164,7 @@ public class NodeBase implements ChannelObserver {
|
||||
* @param action type of product operation to do
|
||||
* @param product product to proceed
|
||||
*/
|
||||
public void doAction(ProductOperationType action, Product product)
|
||||
public void doAction(ProductOperationType action, Product product) throws IllegalCallerException
|
||||
{
|
||||
if(action.getNode().equals(this.nodeType))
|
||||
new Action(this, product, action);
|
||||
|
||||
@ -22,11 +22,17 @@ public class DoActionStep extends ScenarioStep {
|
||||
|
||||
@Override
|
||||
void execute() {
|
||||
if (product != null){
|
||||
nodeBase.doAction(productOperationType, product);
|
||||
//todo maybe do a better error handling
|
||||
try {
|
||||
if (product != null) {
|
||||
nodeBase.doAction(productOperationType, product);
|
||||
}
|
||||
else {
|
||||
nodeBase.doAction(productOperationType);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nodeBase.doAction(productOperationType);
|
||||
catch (IllegalCallerException e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user