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 action type of product operation to do
|
||||||
* @param product product to proceed
|
* @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))
|
if(action.getNode().equals(this.nodeType))
|
||||||
new Action(this, product, action);
|
new Action(this, product, action);
|
||||||
|
|||||||
@ -22,11 +22,17 @@ public class DoActionStep extends ScenarioStep {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void execute() {
|
void execute() {
|
||||||
if (product != null){
|
//todo maybe do a better error handling
|
||||||
|
try {
|
||||||
|
if (product != null) {
|
||||||
nodeBase.doAction(productOperationType, product);
|
nodeBase.doAction(productOperationType, product);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nodeBase.doAction(productOperationType);
|
nodeBase.doAction(productOperationType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (IllegalCallerException e) {
|
||||||
|
System.err.println(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user