Yes, you can send arguments to the environment as well as get feedbacks.
For example, in an application, a method that is changing a LED of a robot could be like this (this belongs to a class that extends Artifact - CArtAgO):
@OPERATION
void changeLedPin(String newState) throws Exception {
try {
/** put gpio HIGH */
if (newState.equals("high")) {
logger.info("Changing pin to HIGH!");
ledPin.high();
}
/** put gpio LOW */
if (newState.equals("low")) {
logger.info("Changing pin to LOW!");
ledPin.low();
}
} catch (Exception e) {
e.printStackTrace();
}
}
Jason's agent code to invoke this external action could be like this:
!start.
+!start <-
changeLedPin(low).
For feedbacks you can use OpFeedbackParam sending in Jason code a variable to unify. The artifact method is something like this:
@OPERATION
void inc(OpFeedbackParam<String> value) {
/* some code */
}
Sources: https://github.com/cleberjamaral/goldminers/blob/master/src/env/mining/Raspi.java
https://github.com/cleberjamaral/camel-artifact/blob/master/camelJaCaMoRobot/src/env/artifacts/Counter.java