Reference

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

Reference

Post by [email protected] »

I have a 2 BOs.

Ref_Step_Type
Step

Ref_Step_Type has 2 attributes.
Predecessor>Reference>Ref_Step_Type (Multiple Allowed)
Successor>Reference>Ref_Step_Type (Multiple Allowed)

I have a process that creates a BO Step based off of the BO Ref_Step_Type. The BO Step has the same 2 attributes --- Predecessor and Successor. I need to assign the same references to Step.Predecessor and Step.Successor that exist at the Ref_Step_Type.Predecessor and Ref_Step_Type.Successor BO.

I am drawing a blank as to how to do that within a process.
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

Solution

Post by [email protected] »

Solution was to add these 2 statements to the process:

INSERT Ref_Step_Type.Predecessor IN Step.Predecessor
INSERT Ref_Step_Type.Successor IN Step.Successor
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

More Help

Post by [email protected] »

I last posted a solution that isn't correct. Let me simplify the requirement:

2 BOs each containing just 2 attributes.

Step
Predecessor = a reference to Step (Multiple Allowed)
Code= Plain text

Ref_Step_Type
Predecessor = a reference to Ref_Step_Type (Multiple Allowed)
Code= Plain text

I need to create the Predecessor values at the Step BO based off of the same data in the Ref_Step_Type.Predecessor rows where Step.Code=Ref_Step_Type.Code

Process 1
FIND Step WHERE Step.Code = 'ABC'
FIND Ref_Step_Type WHERE Step.Code=Ref_Step_Type.Code (will return many)

Now I need to Loop through each of the Ref_Step_Type.Predecessor records and find the matching Step records to insert into the Step.Predecessor the Step.

This all sounds a bit confusing. Hopefully someone can help!
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

If your question is about "looping", that has been covered quite a few times recently.... "IN BATCHES OF..." and 1 process calling a second process. You don't show either of those concepts in your example????
Tom - V8.8 build 3137 - MySql / PostGres
[email protected]
Posts: 278
Joined: Tue Aug 05, 2008 3:16 pm

Posts

Post by [email protected] »

I have read those posts. To me this is a little more complicated because I need to loop within the records for the same BO. So, when I FIND Step in Process 1 and then have a Process 2 that needs to do another FIND of Step, what will happen? How does one process know the difference between 2 FIND statements for the same object.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Explore THIS and THAT prefixes. Check out User Guide and Rule Lanaguage Reference.
Tom - V8.8 build 3137 - MySql / PostGres
pixerp
Posts: 180
Joined: Sun Jan 28, 2007 7:12 pm

Post by pixerp »

rgates,

Does Step.Code and/or Ref_Step_Type.Code hold unique values ?

Maybe you should post a sample of data...
Build 1246 - Windows/Mysql
Post Reply