We have moved at community.getvera.com

Author Topic: ALTUI: Workflows Issues  (Read 28635 times)

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #15 on: March 25, 2016, 06:19:20 pm »
Hi,

I'm still trying to get myself started with some workflows:

Does the "test code" feature work? I get {"success":false} which I presume means fail? Is there a way to get more info as to what was causing the failure?
which "test code" feature ? on which screen

Also -- for troubleshooting purposes, is there any way to follow the transitions as they execute and see which is the currently active state?
Yes, using the Lua Luup log. you can grep on "ALTUI"  or to limit to workflow related stuff you can grep on "ALTUI: Wkflow -" string
you get a result like
Code: [Select]
50 03/25/16 23:17:33.116 luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
50 03/25/16 23:17:33.167 luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
50 03/25/16 23:17:36.386 luup_log:216: ALTUI: Wkflow - Valid Transition found. Label:Lamp is On  <0x76db6520>
50 03/25/16 23:17:36.387 luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Lamp On)  <0x76db6520>
As you described earlier -- I get the intent of the "start" state (thanks for adding the global transitions). Now -- if I want to get out of "start" right away is there a way to do it so I'm not awaiting any variable transitions? (i.e. I set a timer of 1 second)
a transition without any condition and with a timer of 1 or 2 sec should do the trick

A few cosmetics: It's very easy to accidentally delete transitions when trying to edit them. Perhaps a confirmation dialog for deletes would obviate that problem? Lastly, is it possible to scroll the window if the diagram gets to big for the frame?
will look

Thanks!! I'm enjoying playing with the workflows!
-Ted

Offline tedp

  • Sr. Member
  • ****
  • Posts: 288
  • Karma: +6/-2
Re: ALTUI: Workflows
« Reply #16 on: March 26, 2016, 01:12:57 am »
Hi,

I'm still trying to get myself started with some workflows:

Does the "test code" feature work? I get {"success":false} which I presume means fail? Is there a way to get more info as to what was causing the failure?
which "test code" feature ? on which screen

Also -- for troubleshooting purposes, is there any way to follow the transitions as they execute and see which is the currently active state?
Yes, using the Lua Luup log. you can grep on "ALTUI"  or to limit to workflow related stuff you can grep on "ALTUI: Wkflow -" string
you get a result like
Code: [Select]
5003/25/16 23:17:33.116luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:33.167luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:36.386luup_log:216: ALTUI: Wkflow - Valid Transition found. Label:Lamp is On  <0x76db6520>
5003/25/16 23:17:36.387luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Lamp On)  <0x76db6520>
As you described earlier -- I get the intent of the "start" state (thanks for adding the global transitions). Now -- if I want to get out of "start" right away is there a way to do it so I'm not awaiting any variable transitions? (i.e. I set a timer of 1 second)
a transition without any condition and with a timer of 1 or 2 sec should do the trick

A few cosmetics: It's very easy to accidentally delete transitions when trying to edit them. Perhaps a confirmation dialog for deletes would obviate that problem? Lastly, is it possible to scroll the window if the diagram gets to big for the frame?
will look

Thanks!! I'm enjoying playing with the workflows!
-Ted
There's an option to "test code" when saving a workflow.

Sent from my BN NookHD+ using Tapatalk


Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #17 on: March 26, 2016, 05:04:29 am »
Hi,

I'm still trying to get myself started with some workflows:

Does the "test code" feature work? I get {"success":false} which I presume means fail? Is there a way to get more info as to what was causing the failure?
which "test code" feature ? on which screen

Also -- for troubleshooting purposes, is there any way to follow the transitions as they execute and see which is the currently active state?
Yes, using the Lua Luup log. you can grep on "ALTUI"  or to limit to workflow related stuff you can grep on "ALTUI: Wkflow -" string
you get a result like
Code: [Select]
5003/25/16 23:17:33.116luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:33.167luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:36.386luup_log:216: ALTUI: Wkflow - Valid Transition found. Label:Lamp is On  <0x76db6520>
5003/25/16 23:17:36.387luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Lamp On)  <0x76db6520>
As you described earlier -- I get the intent of the "start" state (thanks for adding the global transitions). Now -- if I want to get out of "start" right away is there a way to do it so I'm not awaiting any variable transitions? (i.e. I set a timer of 1 second)
a transition without any condition and with a timer of 1 or 2 sec should do the trick

A few cosmetics: It's very easy to accidentally delete transitions when trying to edit them. Perhaps a confirmation dialog for deletes would obviate that problem? Lastly, is it possible to scroll the window if the diagram gets to big for the frame?
will look

Thanks!! I'm enjoying playing with the workflows!
-Ted
There's an option to "test code" when saving a workflow.

Sent from my BN NookHD+ using Tapatalk
Yes ignore it, that window showing the Json structure of the workflow is meant for debug and will disappear over time. The workflow report gives the user friendly view of it.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #18 on: March 26, 2016, 02:25:36 pm »
a transition without any condition and with a timer of 1 or 2 sec should do the trick

in fact , it does not work, so I will have a look at it to enable that

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #19 on: March 26, 2016, 06:45:59 pm »
Hi,

I'm still trying to get myself started with some workflows:

Does the "test code" feature work? I get {"success":false} which I presume means fail? Is there a way to get more info as to what was causing the failure?
which "test code" feature ? on which screen

Also -- for troubleshooting purposes, is there any way to follow the transitions as they execute and see which is the currently active state?
Yes, using the Lua Luup log. you can grep on "ALTUI"  or to limit to workflow related stuff you can grep on "ALTUI: Wkflow -" string
you get a result like
Code: [Select]
5003/25/16 23:17:33.116luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:33.167luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Start)  <0x743b6520>
5003/25/16 23:17:36.386luup_log:216: ALTUI: Wkflow - Valid Transition found. Label:Lamp is On  <0x76db6520>
5003/25/16 23:17:36.387luup_log:216: ALTUI: Wkflow - nextWorkflowState(216, Workflow 0-1, Start ==> Lamp On)  <0x76db6520>
As you described earlier -- I get the intent of the "start" state (thanks for adding the global transitions). Now -- if I want to get out of "start" right away is there a way to do it so I'm not awaiting any variable transitions? (i.e. I set a timer of 1 second)
a transition without any condition and with a timer of 1 or 2 sec should do the trick

A few cosmetics: It's very easy to accidentally delete transitions when trying to edit them. Perhaps a confirmation dialog for deletes would obviate that problem? Lastly, is it possible to scroll the window if the diagram gets to big for the frame?
will look

Thanks!! I'm enjoying playing with the workflows!
-Ted
There's an option to "test code" when saving a workflow.

Sent from my BN NookHD+ using Tapatalk

Tedp/Others
there is a beta version installable with the magic url
<yourip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8246&Version=30941

which brings
  • start state timer transition to first state
  • confirmation on delete link click ( but there is a side effect, if you say cancel, the mouse is captured and the transition label is dragged around the link. it is an interesting side effect , not sure yet how to use this better)
  • Used In page ( in device control panel ) shows use in a workflow
  • the workflow JSON structure is displayed at time of workflow saving, only if ALTUI is in DEBUG mode

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #20 on: March 26, 2016, 07:06:05 pm »
if you have problem saving workflows with it, go to J_ALTUI_verabox.js line 1218 and change it to
Code: [Select]
var maxchar = 2000;

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #21 on: March 27, 2016, 05:29:11 pm »
integrated the fixes in the last release. plus a potential source of "no handler" issue.
however if , after waiting a while , you get the no handler issue, you please need to enable DEBUG mode ( using UI5/7 ) then reload Luup, capturing the log and send me the log along with the version number you are using so I can trouble shoot.

manual install : ?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8246&Version=30950

Offline xeinth

  • Full Member
  • ***
  • Posts: 144
  • Karma: +1/-1
Re: ALTUI: Workflows
« Reply #22 on: March 29, 2016, 01:07:54 pm »
amg,

The latest versions seems to address my No Handler issues, although I think I found some thing that can still cause them along with a few comments/feature requests =).  I love the history feature.  A+ for debugging

  • using new==1 instead of new=='1' for checking the status crashes luup.  This can also can cause constant restarts as the condition is still being met, so it can be hard to clear.  It might be good to handle this scenario
  • It would be really helpful to support triggers or watches.  If you want to use a scene controller for example, to override a timed light, you need to only transition on a new event, even if the scene doesn't change.  I.e. you can't evaluate just the current value, but only 'new' values.  This could be done perhaps with the scene time, but haven't figured that out yet
  • small detail, but using just an arrow for a transition doesn't work.  You need a timer with at least 1 second.  This could be intent to prevent race conditions but if thats the case perhaps a one second delay can be inferred rather than 'breaking' the state machine.
  • It would be nice to enable/disable individual workflows as new things are being tested
  • The workspace editor can't scroll horizontally, at least in Safari.  This can cause problems switching between devices or resolutions as if you design it in something with a large screen, you can't see it all on a smaller screen
  • A feature request would be to have the equivalent of a variable container built into the workflow engine, either globally or local to a given workflow.  The use case is to maintain values in addition to maintaining state.  For example a thermostat controller could have a variable for temperature, that is edited based on schedule, occupancy or incremented up/down by either a echo, switch or whatever.  For the inc/dec case, you need the previous value which could have been set thru a number of methods, and polling the device and inc/decing is not ideal.  This could be integrated into the state actions.  The only remaining thing the user would need to do (this could be built in as well, or done separately), is to track the updates to this variable and push them to a device.  You wouldn't want to do that manually in the state machine, you'd want that evaluated based on changes to the variable alone
  • A timer which has no name, but a time won't execute.  Not a big one but if you are lazy it will lock things up.  Generally the timer name is sort of pointless as we only have 1 timer, and I seem to have transitions with just a timer only, making the naming redundant
  • When a luup crash occurs, the state machine seems to restore to the last state.  Not sure if that is the best behavior or returning to the start state is best.  If we hold the same state, it would be nice to leverage the global reset of sorts to return to start, but I'm not sure there is a great way to do this that would work for all workflows.  If there was a 'restart' device/variable we could trigger the start state on, that might be useful.

Sorry for the dump of things, but you have to deal with the consequences when you get peoples hopes up like this.   This is the best way to do complex control graphically I've seen yet, by far.  Thanks.

bk
« Last Edit: March 29, 2016, 05:44:39 pm by xeinth »

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #23 on: March 30, 2016, 11:29:19 am »
    Thank for the inputs. Good to have some real testers :-)

  • using new==1 instead of new=='1' for checking the status crashes luup.  This can also can cause constant restarts as the condition is still being met, so it can be hard to clear.  It might be good to handle this scenario
will be adding a pcall() to protect this now
  • It would be really helpful to support triggers or watches.  If you want to use a scene controller for example, to override a timed light, you need to only transition on a new event, even if the scene doesn't change.  I.e. you can't evaluate just the current value, but only 'new' values.  This could be done perhaps with the scene time, but haven't figured that out yet
I do not understand. if you have a transition with your remote controller and a condition on a variable like sl_LastScene and button value, it should be able to match the transition at the press of the button ( since transition are evaluated based on luup.watch , so based on trigger
  • small detail, but using just an arrow for a transition doesn't work.  You need a timer with at least 1 second.  This could be intent to prevent race conditions but if thats the case perhaps a one second delay can be inferred rather than 'breaking' the state machine.
agreed, but I d rather the user know what he is doing, indeed a transition must wait on something. I ll check what could be done to default something
  • It would be nice to enable/disable individual workflows as new things are being tested
adding it
  • The workspace editor can't scroll horizontally, at least in Safari.  This can cause problems switching between devices or resolutions as if you design it in something with a large screen, you can't see it all on a smaller screen
are you talking about mobile safari , or desktop safari  ? on mobile device I know but some other things are not working well on mobile. i wonder if people would really use mobile to edit workflows.  on IE and Chrome I do get the proper scrolling behavior ( it appear only when the area is larger than the screen and it automatically enlarge the area if you drag and drop something beyond the boundaries right now ). I need to find a safari desktop to test. I ll probably not be able to fix it no mobile screens, touch & scrolling are not consistent enough there and jointjs library has its own quirckness as well
  • A feature request would be to have the equivalent of a variable container built into the workflow engine, either globally or local to a given workflow.  The use case is to maintain values in addition to maintaining state.  For example a thermostat controller could have a variable for temperature, that is edited based on schedule, occupancy or incremented up/down by either a echo, switch or whatever.  For the inc/dec case, you need the previous value which could have been set thru a number of methods, and polling the device and inc/decing is not ideal.  This could be integrated into the state actions.  The only remaining thing the user would need to do (this could be built in as well, or done separately), is to track the updates to this variable and push them to a device.  You wouldn't want to do that manually in the state machine, you'd want that evaluated based on changes to the variable alone
we need to discuss this more, I am not undersatnding yet fully how this would work. Also fearing that I do not want to turn into a whole lot of code writing for the users because if you talk about variable, you ll likely talk about arythmetic expressions with them etc..

  • A timer which has no name, but a time won't execute.  Not a big one but if you are lazy it will lock things up.  Generally the timer name is sort of pointless as we only have 1 timer, and I seem to have transitions with just a timer only, making the naming redundant
fixing this in the UI
  • When a luup crash occurs, the state machine seems to restore to the last state.  Not sure if that is the best behavior or returning to the start state is best.  If we hold the same state, it would be nice to leverage the global reset of sorts to return to start, but I'm not sure there is a great way to do this that would work for all workflows.  If there was a 'restart' device/variable we could trigger the start state on, that might be useful.
Yes ,  I kind of prefer the restart in the state where it was, but I am adding a UPNP ALtUI action to reset a particular workflow so you can then use this as a scene action or even as a workflow state action.
will be in next release

[/list]
« Last Edit: March 30, 2016, 01:32:53 pm by amg0 »

Offline xeinth

  • Full Member
  • ***
  • Posts: 144
  • Karma: +1/-1
Re: ALTUI: Workflows
« Reply #24 on: March 30, 2016, 09:12:20 pm »
Pruning down the response, you checked a lot off the list =).

-Perhaps I need to come up with an example or test what you suggested, but I was using sl_SceneActivated, and that definitely seemed to not trigger.  I had to capture the scenario if the scene was already active.
-Regarding the scrolling issue on Safari, it does happen on desktop and mobile, but I found I can swipe the trackpad to get it to scroll.  There are no drawn slider bars.  As to mobile, agree wouldn't want to edit on mobile, but its REALLY nice to debug the logic by watching the state machine on your mobile as you test out scene controllers.  This is how I found some of the issues..
-Regarding the variable container request, I saw on a earlier page you already had that as a planned feature (i.e. keeping variables) along with schedules and a few other things.  The would be great, the only possible request in addition is if we could expose them.  Let me see if I can do an example with external variable containers.

One other thing, having a backup facility might be good.  I deleted a single workflow, and I think it ended up deleting the wrong one, but I could have been mistaken.

Thanks for the great work.  Once the schedules are in place I've got a pretty cool example to try out =).
x

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #25 on: April 02, 2016, 05:31:46 pm »
One other thing, having a backup facility might be good.  I deleted a single workflow, and I think it ended up deleting the wrong one, but I could have been mistaken.
I am halfway in schedules... stay tuned
regarding backup, you can go to MISC/DEBUG/Javascript code and type in
Code: [Select]
WorkflowManager.getWorkflows()
for the restore it can be done with this ( where <workflow_object> is what you got from above ) followed by a luup reload
Code: [Select]
WorkflowManager.init(  <workflow_object> )
« Last Edit: April 08, 2016, 04:44:04 pm by amg0 »

Offline javed222uy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: ALTUI: Workflows
« Reply #26 on: April 02, 2016, 06:06:04 pm »
Can you upload a complete report of the first sample?
Thanks

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #27 on: April 03, 2016, 10:03:26 am »
Can you upload a complete report of the first sample?
Thanks

here you are.  I will post very soon now a version with many bug fixes for timers and the scheduled transition capability

EDIT: adding another example for an activity I want every 5min
EDIT2: version with scheduled transition is published. v1394
« Last Edit: April 03, 2016, 10:32:32 am by amg0 »

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: ALTUI: Workflows
« Reply #28 on: April 03, 2016, 10:52:16 am »
Small tip:
you can click on an expression and edit it directly here.  or, you can click on the pencil icon and edit it with the Blockly editor ( but here, you have to edit it from scratch as I did not want to save a very long XML blockly definition within the workflow object which is already quite long )

Offline javed222uy

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: ALTUI: Workflows
« Reply #29 on: April 03, 2016, 02:11:21 pm »
Thank You Amg0!!
I will tray!