Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
CreateRunTask error
suj
I'm trying to get an mbruntask object in my code and it throws an error
Object doesn't support this property or method: 'CreateRunTask'
I'm trying to create an mbruntask and pass it to the revisefile method. The code snippet is below:
-----------------------------------------------------------------
set objMBSavedTask = Session.GetTask("{1ECCFAEA-5582-412A-A826-763AAF1E0A3F}")
set objMBRunTask = objMBSavedTask.CreateRunTask()
strJobIdentifier = MBExistingAsset.ReviseFile(strAssetPath, objMBRunTask,"Update File")
-----------------------------------------------------------------
I'm able to print the objMBSavedTask.Name and it returns me '(Insert Unmodified)'
and the API documentation says we can create a runtask from saved task.
Any ideas?
Env: MB 4.5.3/win2003
TIA
Find more posts tagged with
Comments
Migrateduser
Sorry, this appears to be misleading. CreateRunTask has been created as a PROPERTY of a saved task object. Therefore, the parenthesis as illegal. I duplicated the error with your code, then removed the parenthesis after CreateRunTask and it seems to work fine.
Yes... it would seem that it should either be a method or be named simply RunTask, which implies it would be a property. Sorry for the confusion.
suj
Thank You! That helped to over come the error. But I still have a general question about the way ReviseFile works. i see that it takes only a local path and not a mediabin path. We have a mediabin based hot folder where user drops a file and based on metadata it needs to be moved to another folder within mediabin. We have set the Options.xml to trigger an ASP to do this. But I see that if the asset already exists in the target folder, then I need to do the following
1) Retrieve the file from hot folder to a temp location
2) Call revisefile to update the target asset with this
3) Delete the file from temp location and from hot folder
Is there a simpler way to achieve this?
Migrateduser
I'll ask our Hot Folders expert to comment on this one.
suj
Also, I see that the options.xml is not triggerring a web URL request for the event 'ContainerChildContainerAdded', although the email request is triggerred.
Is this a BUG with options.xml or am I missing something?
This is the code snippet
<WebRequestOption mEvent="ContainerChildContainerAdded" mAuthentication="Anonymous" mDomain="" mUsername="" mPassword="">
<mURL>
http://<server>/mediabin/AVUpdate.asp?mbAssetId={0}</mURL>
;
</WebRequestOption>
msnider
Unfortunately, there's currently not a mechanism to revise an asset using an existing asset within MediaBin. However, I'm not sure of your exact setup but the HotFolder application will automatically revise files if a naming conflict occurs. So if your incoming files are named exactly the same as the existing asset within MediaBin, then the asset should be automatically revised with no additional code needed. Are you not experiencing this?
As for the ContainerChildContainerAdded not triggering a URL, that's actually by design as the URL option was only meant to function on assets. However, if you need it to be extended to containers, then go ahead and submit a feature request and we can get it into the next release.
Mark
suj
Thanks Mark. Unfortunately, we cannot have hot folders move the asset, because the asset that comes in to the hot folder needs to be moved to the final destination based on metadata. I think I may have to go with a scheduled task for this and convert my ASP to run as vbscript scheduled task.
Not much change though.
I shall file a feature request for triggering a web URL for container. But I believe it should have been a fairly simple thing for Iwov to do that when they came out with this option. Is there a way to tweak in this somewhere (probably in registry or somewhere?)