otmfaqForumsBlogsRegister
FAQMembers ListCalendarToday's PostsSearch


 Subscribe Blogs:RSS
 Subscribe Forums:RSS
 Follow New Posts:Twitter
OTMFAQ Home
OTMFAQ Blogs
OTMFAQ Forums
OTM Wiki

OTM SIG
OTM Wiki
MavenWire


Order Processing Shipment planning and order processing - including data requirements, line items, ship units, order bases and order releases.

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old July 17th, 2009, 17:54
Junior Member
 
Join Date: Feb 2008
Location: Mexico
Posts: 4
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
pesr0412 is on a distinguished road
Send a message via MSN to pesr0412 Send a message via Yahoo to pesr0412 Send a message via Skype™ to pesr0412
Update through Data Query

Hi,

I am trying to achieve the following:

I want to make an update to some orders that meets certain conditions. I also want this process to be scheduled to run at some time in a regular basis.

I was trying to use Data Query within Business Process Automation/Process Management option becuase this allows for scheduling and recurrence. So I defined a saved query with the update sql query. The problem is that when I try to run the data query it does not allow the saved query to run as it is not a select kind of query.

I know that this could be easily be done in the actual DB. But the idea behind this is to give an OTM user the ability to control when do the update can take place.

Any ideas of how can this be achieved? Are there any other way to accomplish the same?

Many thanks in advance

Sincerely,
Ricardo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old July 17th, 2009, 19:07
Member
 
Join Date: Jul 2006
Posts: 48
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 16
Thanked 11 Times in 9 Posts
Rep Power: 0
acuartero is on a distinguished road
Re: Update through Data Query

Ricardo,

I've done something similar to this. You can achieve the same effect as an UPDATE by calling an Autonomous PL/SQL function from a SELECT statement that passes the GIDs for the objects that you want to update to the function. Make sure you define the function with PRAGMA AUTONOMOUS_TRANSACTION otherwise it won't be able to modify the data that is returned from the calling SELECT, in the function body put your update statement and as the parameter pass the GID of the object that you want to update. You should also make sure you have proper exception handling and it might also be worthwhile to have the function return a numeric value indicating success or failure.

Thanks,
Alan

Last edited by acuartero; July 17th, 2009 at 19:23.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to acuartero For This Useful Post:
pesr0412 (July 17th, 2009)
  #3 (permalink)  
Old July 17th, 2009, 19:43
Member and Blogger
 
Join Date: Oct 2007
Location: Netherlands
Posts: 209
Groans: 0
Groaned at 2 Times in 1 Post
Thanks: 18
Thanked 31 Times in 28 Posts
Rep Power: 3
LourensGlog is on a distinguished road
Send a message via AIM to LourensGlog Send a message via Yahoo to LourensGlog
Re: Update through Data Query

The 'OTM' way of achieving this is to set up an order data query triggering a custom event, have an agent listen to this event, and update your orders using a DSU in that agent.
Let me know if you need help to set this up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to LourensGlog For This Useful Post:
pesr0412 (July 17th, 2009)
  #4 (permalink)  
Old July 17th, 2009, 20:06
Junior Member
 
Join Date: Feb 2008
Location: Mexico
Posts: 4
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
pesr0412 is on a distinguished road
Send a message via MSN to pesr0412 Send a message via Yahoo to pesr0412 Send a message via Skype™ to pesr0412
Re: Update through Data Query

Just perfect!

I made the PRAGMA AUTONOMOUS... thing and tested it, and it worked smoothly...

Thank you Alan!

Quote:
Originally Posted by acuartero View Post
Ricardo,

I've done something similar to this. You can achieve the same effect as an UPDATE by calling an Autonomous PL/SQL function from a SELECT statement that passes the GIDs for the objects that you want to update to the function. Make sure you define the function with PRAGMA AUTONOMOUS_TRANSACTION otherwise it won't be able to modify the data that is returned from the calling SELECT, in the function body put your update statement and as the parameter pass the GID of the object that you want to update. You should also make sure you have proper exception handling and it might also be worthwhile to have the function return a numeric value indicating success or failure.

Thanks,
Alan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old July 17th, 2009, 20:26
Junior Member
 
Join Date: Feb 2008
Location: Mexico
Posts: 4
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
pesr0412 is on a distinguished road
Send a message via MSN to pesr0412 Send a message via Yahoo to pesr0412 Send a message via Skype™ to pesr0412
Re: Update through Data Query

Lourens,

Although Alan's method works nice, I would definitively want to know how to setup using the OTM way you mention, please by all means help me. It is better to have many options available.

Quote:
Originally Posted by LourensGlog View Post
The 'OTM' way of achieving this is to set up an order data query triggering a custom event, have an agent listen to this event, and update your orders using a DSU in that agent.
Let me know if you need help to set this up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old July 20th, 2009, 22:03
Member and Blogger
 
Join Date: Oct 2007
Location: Netherlands
Posts: 209
Groans: 0
Groaned at 2 Times in 1 Post
Thanks: 18
Thanked 31 Times in 28 Posts
Rep Power: 3
LourensGlog is on a distinguished road
Send a message via AIM to LourensGlog Send a message via Yahoo to LourensGlog
Re: Update through Data Query

Ricardo,

Assuming you have created a saved query called ORDER RELEASE - EXAMPLE SAVED QUERY, if you create the objects as described below, OTM will run your query every night at 4 am (system time), and run an agent for each individual order in that query. Take care that these agents will run in parallel, so take this into account when writing your DSUs.

1. Create a Custom Agent Event
Business Process Automation > Power Data > Event Management > Agent Events > New
Agent Event ID: ORDER RELEASE - CUSTOM EVENT (example)
Data Query Type ID: ORDER RELEASE

2. Set up Recurring Process to trigger the Manual Agent Event
Business Process Automation > Process Management > Business Process Automation > Data Query
Data Query Type: ORDER RELEASE
Based on: ORDER RELEASE - EXAMPLE SAVED QUERY
Raise Event: ORDER RELEASE - CUSTOM EVENT (previously defined)
Schedule: At <Next Day 04:00:00>, Every 1 D
Click Submit

3. Create Agent that listens to Manual Agent Event
Business Process Automation > Agents and Milestones > Automation Agent > New
Agent ID: ORDER RELEASE - EXAMPLE AGENT (example)
Agent Type: ORDER RELEASE
Active: ticked
Agent Events:
Event: ORDER RELEASE - CUSTOM EVENT (previously defined)
Restrictions: (none)
Actions: (enter your actions here)

Good luck,

Lourens
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subject Line of Data Query surender Workflow and Agents 0 June 12th, 2009 07:08
Can I update customer data from a source system? avonnieda Integration and Data Mapping 5 March 10th, 2009 13:16
Remote Query Reply Interface not sending data to an External system nikesh mohanlal Integration and Data Mapping 11 December 9th, 2008 23:18
mass update tailsjt Order Processing 0 October 16th, 2008 14:34
OTM Training Update chrisplough Documents and Attachments 0 December 1st, 2006 19:26



All times are GMT. The time now is 00:53.
Copyright © 2006-2009, Open Book Solutions LLC. All rights reserved.


Inactive Reminders By Icora Web Design

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40