Difference between revisions of "Reasoner by Resource"
(8 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
# MainMenu/Activities/Reasoner | # MainMenu/Activities/Reasoner | ||
# Click create | # Click create | ||
− | # Select For Each | + | # Select For Each Thing |
# Enter a Name | # Enter a Name | ||
# Once The Reasoner editor is open | # Once The Reasoner editor is open | ||
Line 17: | Line 17: | ||
# Select Action Create, | # Select Action Create, | ||
# Dialog Box for create will be open Select by recurso | # Dialog Box for create will be open Select by recurso | ||
− | # Select type of | + | # Select type of thing you want to create |
# Enter a label to identify the action | # Enter a label to identify the action | ||
# On right side click on action | # On right side click on action | ||
Line 29: | Line 29: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | #: | + | #:{{Note|There are required fields if user does not enter them the reasoner wont run}} |
# Run reasoner | # Run reasoner | ||
Expected | Expected | ||
− | For each | + | For each thing returned by observer system will create a new thing |
====Update ==== | ====Update ==== | ||
Line 48: | Line 48: | ||
Expected | Expected | ||
− | The system will update each | + | The system will update each thing returned by the observer |
====Send Notification ==== | ====Send Notification ==== | ||
Line 68: | Line 68: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | {{Note|There are required fields if user does not enter them the reasoner wont run}} | |
====Schedule Send Observation ==== | ====Schedule Send Observation ==== | ||
− | The same as send observation user just need to specify Initiation Date and time, occurrence and frequency | + | The same as send observation user just need to specify Initiation Date and time, occurrence and frequency |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time | + | {{Note| |
+ | :Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time | ||
+ | :Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once | ||
+ | :Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time}} | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Line 88: | Line 87: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | {{Note|There are required fields if user does not enter them the reasoner wont run.}} | |
Expected | Expected | ||
− | For each | + | For each thing returned by the observer the system will schedule to send a new observation |
===Reasoner At Least One === | ===Reasoner At Least One === | ||
Line 100: | Line 99: | ||
# MainMenu/Activities/Reasoner | # MainMenu/Activities/Reasoner | ||
# Click create | # Click create | ||
− | # Select At least one | + | # Select At least one thing |
# Enter a Name | # Enter a Name | ||
# Once The Reasoner editor is open | # Once The Reasoner editor is open | ||
Line 108: | Line 107: | ||
# Select Action Create, | # Select Action Create, | ||
# Dialog Box for create will be open Select by recurso | # Dialog Box for create will be open Select by recurso | ||
− | # Select type of | + | # Select type of thing you want to create |
# Enter a label to identify the action | # Enter a label to identify the action | ||
# On right side click on action | # On right side click on action | ||
Line 120: | Line 119: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | #: | + | #:{{Note|There are required fields if user does not enter them the reasoner wont run.}} |
# Run reasoner | # Run reasoner | ||
Expected | Expected | ||
− | If Observer return at least one | + | If Observer return at least one thing the system will create a new thing if observer does not return thing system won't create the new thing |
====Send Notifications ==== | ====Send Notifications ==== | ||
Line 143: | Line 142: | ||
====Schedule Send Observations ==== | ====Schedule Send Observations ==== | ||
The same as send observation user just need to specify Initiation Date and time, occurrence and frequency | The same as send observation user just need to specify Initiation Date and time, occurrence and frequency | ||
− | |||
− | Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time | + | {{Note| |
− | + | :Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time | |
− | Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once | + | :Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once |
− | + | :Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time}} | |
− | Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time | + | |
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Line 159: | Line 156: | ||
Expected | Expected | ||
− | If Observer return at least one | + | If Observer return at least one thing the system will Schedule to send a new Observation |
===Reasoner Only Observations === | ===Reasoner Only Observations === | ||
Line 175: | Line 172: | ||
Expected | Expected | ||
− | If the run of Observer is positive the system will Create a New | + | If the run of Observer is positive the system will Create a New thing |
====Send Notifications ==== | ====Send Notifications ==== | ||
Line 199: | Line 196: | ||
The same as send observation on Action select schedule observations user just need to specify Initiation Date and time, occurrence and frequency | The same as send observation on Action select schedule observations user just need to specify Initiation Date and time, occurrence and frequency | ||
− | + | {{Note| | |
− | + | :Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time | |
− | Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time | + | :Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once |
− | + | :Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time}} | |
− | Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once | + | |
− | + | ||
− | Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time | + | |
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Line 234: | Line 228: | ||
Expected | Expected | ||
− | If Observer do not return | + | If Observer do not return a thing the system will create a new thing |
====Send Notifications ==== | ====Send Notifications ==== | ||
Line 250: | Line 244: | ||
Expected | Expected | ||
− | If Observer do not return | + | If Observer do not return a thing the system will Send Observation |
====Schedule Send Observations ==== | ====Schedule Send Observations ==== | ||
Line 264: | Line 258: | ||
Expected | Expected | ||
− | If Observer do not return | + | If Observer do not return a thing the system will Schedule and send observation according to schedule |
Latest revision as of 22:33, 20 October 2016
Contents
Reasoner For each
Create
- MainMenu/Activities/Reasoner
- Click create
- Select For Each Thing
- Enter a Name
- Once The Reasoner editor is open
- Enter Description
- Select the observer
- Select Topic from where you are getting the observation
- Select Action Create,
- Dialog Box for create will be open Select by recurso
- Select type of thing you want to create
- Enter a label to identify the action
- On right side click on action
- Select on right side new fields and user can see he can write the info using javascript
- Example:
-
function(newthing,observation,thing,summary){ newthing._name ="Entity77"+ new Date().getTime().toString(); newthing.DoubleData = observation.ObsDoubleData; newthing.description ="Testing Create by recurso"; }
- Note: There are required fields if user does not enter them the reasoner wont run
- Run reasoner
Expected
For each thing returned by observer system will create a new thing
Update
Same steps as Create
function(updatething,observation,thing){
updatedthing.description ="Bless be the ones who serve others. They are the ones who find heaven on earth.";
updatedthing.CityPopulation = 123000123;
}
Expected The system will update each thing returned by the observer
Send Notification
same as for each send notification by properties
Delete
same as for each Delete by properties
Send Observations
function(newobservation,observation,thing){
newobservation._name = "SendObserRecurso"+ new Date().getTime().toString();
newobservation.topic = observation.topic; (Required field)
newobservation.producer = observation.producer; (Required field)
}
Note: There are required fields if user does not enter them the reasoner wont run
Schedule Send Observation
The same as send observation user just need to specify Initiation Date and time, occurrence and frequency
Note:
- Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time
- Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once
- Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time
function(newobservation,observation,thing){
newobservation._name = "SendObserRecurso"+ new Date().getTime().toString();
newobservation.topic = observation.topic; (Required field)
newobservation.producer = observation.producer; (Required field)
}
Note: There are required fields if user does not enter them the reasoner wont run.
Expected
For each thing returned by the observer the system will schedule to send a new observation
Reasoner At Least One
Create
- MainMenu/Activities/Reasoner
- Click create
- Select At least one thing
- Enter a Name
- Once The Reasoner editor is open
- Enter Description
- Select the observer
- Select Topic from where you are getting the observation
- Select Action Create,
- Dialog Box for create will be open Select by recurso
- Select type of thing you want to create
- Enter a label to identify the action
- On right side click on action
- Select on right side new fields and user can see he can write the info using javascript
- Example:
-
function(newthing,observation,thing){ newthing._name ="Entity55"; newthing.DoubleData = observation.ObsDoubleData; newthing.description ="Testing Reasoner At least One Create by recurso"; }
- Note: There are required fields if user does not enter them the reasoner wont run.
- Run reasoner
Expected
If Observer return at least one thing the system will create a new thing if observer does not return thing system won't create the new thing
Send Notifications
same as send Notification by properties
Send Observations
function(newobservation,observation,thing){
newobservation._name = "SendObserRecurso333"; (Mandatory Field)
newobservation.topic = observation.topic; (Mandatory Field)
newobservation.producer = observation.producer; (Mandatory Field)
}
Schedule Send Observations
The same as send observation user just need to specify Initiation Date and time, occurrence and frequency
Note:
- Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time
- Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once
- Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time
function(newobservation,observation){
newobservation.producer = "Copertino";
}
Expected
If Observer return at least one thing the system will Schedule to send a new Observation
Reasoner Only Observations
Create
function(newthing,observation){
newthing._name ="EntityObsOnlyRecurso";
newthing.DoubleData = observation.ObsDoubleData;
newthing.description ="Testing Reasoner Obs Only Create by recurso";
}
Expected
If the run of Observer is positive the system will Create a New thing
Send Notifications
same as send notification by properties
Send Observations
function(newobservation,observation){
newobservation._name = "SendObserRecursoObsOnly";
newobservation.topic = observation.topic; (Mandatory field)
newobservation.producer = observation.producer; (Mandatory field)
}
Expected
If the run of Observer is positive the system will Send the observation
Schedule Send Observations
The same as send observation on Action select schedule observations user just need to specify Initiation Date and time, occurrence and frequency
Note:
- Occurrence 0 must enter frequency like; sec, mins, hours etc If user for example enters frequency days that means observation will be send every day forever Starting on the Start date and Time
- Occurrence 1 frequency will be ignore. The system will send that schedule observation on the Start Date and Time only once
- Occurrence 2 or more must enter frequency. The system will send the observation according to frequency and Start Date and Time
function(newobservation,observation){
newobservation._name = "ScheduleSendObserRecursoObsOnly";
newobservation.topic = observation.topic;
newobservation.producer = observation.producer;
}
Expected
If the run of Observer is positive the system will Send the observation
according to the schedule
Reasoner Absence of things
Create
function(newthing,observation){
newthing._name ="EntityDoNotReturnRecurso111";
newthing.DoubleData = observation.ObsDoubleData;
newthing.description ="Testing Reasoner Do not return entity Create by recurso";
}
Expected
If Observer do not return a thing the system will create a new thing
Send Notifications
Send Observations
function(newobservation,observation){
newobservation._name = "SendObserRecursoNoEntity";
newobservation.topic = observation.topic;
newobservation.producer = observation.producer;
}
Expected
If Observer do not return a thing the system will Send Observation
Schedule Send Observations
function(newobservation,observation){
newobservation._name = "ScheduleSendObserRecursoNoEntity";
newobservation.topic = observation.topic;
newobservation.producer = observation.producer;
}
Expected
If Observer do not return a thing the system will Schedule and send observation according to schedule