Picture WAS CHANGED always executes?

If you think that something doesn't work in Aware IM post your message here
Post Reply
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Picture WAS CHANGED always executes?

Post by hpl123 »

Hi support / all,
I have rule that checks if a picture attribute was changed and if so executes an action and this rule fires all of the time even when the picture attribute was not changed (change in my head meaning the picture was deleted, replaced etc.). Is this a bug or intended behavior?

The rule is:
"If MyBo.MyImage WAS CHANGED Then
Action"

All thoughts appreciated. Thanks
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Probably a bug if you are sure that it is always fired...
Aware IM Support Team
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Additional tests

Post by hpl123 »

I have seen this over and over agfain but will run some additional tests and get back to you.
Henrik (V8 Developer Ed. - Windows)
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Picture WAS CHANGED always executes?

Post by RLJB »

I can confirm this is happening, also on Document style attributes too.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
RentProperty
Posts: 345
Joined: Mon Nov 12, 2012 9:08 pm
Location: South Africa

Re: Document WAS CHANGED always executes?

Post by RentProperty »

Hi support, has this issue ever been resolved? I am still seeing this happening on documents. So I have my documents in a file system and every time I save the object that contains the document attribute it triggers the rules that fall under "If DocumentRecord.Document WAS CHANGED AND DocumentRecord.Document IS DEFINED THEN XXX"

Very performance intensive if the system has to export to File System EVERY time an object is saved.

I am using AIM 7.1 Build 2237

Please let me know if anyone else is seeing this. I will prepare a BSV if needed.

Thanks
Hein Hanekom & Werner Hanekom
Sinov8.net
AwareIM Version 5.9 | 6.0 | 7.0 | 7.1 (Windows EC2 R2012 & MySQL)
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Picture WAS CHANGED always executes?

Post by aware_support »

Well, avoid checking WAS CHANGED for pictures and documents - this appears to be a limitation
Aware IM Support Team
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Picture WAS CHANGED always executes?

Post by BenHayat »

aware_support wrote:Well, avoid checking WAS CHANGED for pictures and documents - this appears to be a limitation
I'm in the same boat now, because if an image (as file system) was changed to deleted, I have to make data changes to the BO that owned the image.
When you say avoid checking, then how else can we do the proper actions when we have no events or any way to find out?
For example when a new image is uploaded we read Image metadata and store it in BO, if the image was replaced or deleted, we have to know to modify previous metadata stored in BO.
4xjbh
Posts: 177
Joined: Thu Dec 22, 2005 10:01 pm
Location: Brisbane

Re: Picture WAS CHANGED always executes?

Post by 4xjbh »

Can you check the current (new) and old value for a document and if different update meta data or do some other task?
Regards, James

AwareIM 7.1 on AWS - Beware I'm a AwareIM noob. Anything I help you with might make the hole your in deeper.
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Picture WAS CHANGED always executes?

Post by ACDC »

If you use the following FILE functions on the object containing the Document attribute then you could monitor a change on any one of these attributes. So if the file name or file size changes it would indicate a new file has been uploaded or deleted and your rule can run accordingly - (I am not sure if these functions will apply to a Picture Attribute)

Create 3 additional Attributes i.e. FileExtension, FileName,FileSize and then insert a rule on the object to update as follows:
Object.FileExtension=FILE_EXTENSION(Object.Document)
Object.FileName=FILE_NAME(Object.Document)
Object.FileSize=FILE_SIZE(Object.Document)

BTW, I see there is also a FILE_LAST_MODIFIED function which could work in the some way to be more precise
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Picture WAS CHANGED always executes?

Post by BenHayat »

ACDC wrote:If you use the following FILE functions on the object containing the Document attribute then you could monitor a change on any one of these attributes. So if the file name or file size changes it would indicate a new file has been uploaded or deleted and your rule can run accordingly - (I am not sure if these functions will apply to a Picture Attribute)

Create 3 additional Attributes i.e. FileExtension, FileName,FileSize and then insert a rule on the object to update as follows:
Object.FileExtension=FILE_EXTENSION(Object.Document)
Object.FileName=FILE_NAME(Object.Document)
Object.FileSize=FILE_SIZE(Object.Document)

BTW, I see there is also a FILE_LAST_MODIFIED function which could work in the some way to be more precise
Yes, your suggestion worked for me. Thanks again!
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: Picture WAS CHANGED always executes?

Post by BobK »

Ben,

Does your solution use FILE_LAST_MODIFIED?

Is anybody using FILE_LAST_MODIFIED?

I am trying to use FILE_LAST_MODIFIED and it always returns the current date.

Tested in Version 8.1 Build 2453
Bob
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Picture WAS CHANGED always executes?

Post by BenHayat »

BobK wrote:Ben,

Does your solution use FILE_LAST_MODIFIED?

Is anybody using FILE_LAST_MODIFIED?

I am trying to use FILE_LAST_MODIFIED and it always returns the current date.

Tested in Version 8.1 Build 2453
Bob, I tossed that [aware] project out and did it in another platform and moved on with a working app.
himanshu
Posts: 722
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Picture WAS CHANGED always executes?

Post by himanshu »

Above tip help in restricting the rule to execute when there is no change but there is one flaw, it captures date only... if this will capture complete-time includes seconds then will work for best use cases.

In the meanwhile, I will develop a small plugin to replace existing FILE_LAST_MODIFIED to have a complete timestamp.

Thanks Bob!
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Post Reply