Questions about calling a process with USING

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Questions about calling a process with USING

Post by Jaymer »

this thread from newbie DDumas showed how someone is actually reading the manual.

Near the end of the thread, you can see him doing this:
calledProcessName USING someBOinstance

I thought to myself, "Self, who the hell uses USING?"
He finds 2 inches of example in the entire Docs and uses that as an example of calling a process -- of course with no need to.

So I wonder if anyone actually has a need to call a process that way. I don't think I've ever needed to.
Like many things in the manual, I don't see WHY I would use it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
customaware
Posts: 2401
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Questions about calling a process with USING

Post by customaware »

I am sure I have used it somewhere but for the life of me cannot remember where but vaguely recall this situation....

Passed BO to a process input is instance of MyBO (This)

FIND MyBO WHERE Blah, Blah (some other instance of MyBO..... That)
ExecuteMySubProcess USING ThatMyBO

The other place which I discovered some time ago..... slightly diferent but neat all the same....

Imagine you have a Query of Child and the Parent is not in context. But, the Child is Owned by Parent.
When calling a process from say, Operation With Reocrds or Panel Operations you can pass a Reference.... Expected By Process Parent , Passed from Operation Child.ob_Parent

If you did not know that then you would probably set the Process to have Child as the Input and have FIND Parent WHERE Parent = Child.ob_Parent as the first Rule in the Process but it is not necessary.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Questions about calling a process with USING

Post by PointsWell »

It is required in certain circumstances to where the context is not clear. The specific instance I had was where I had a hierarchy of related BOs.

If you have a grid displaying a tree of BOs and expand out the parent then choose the child to execute a process you actually have two BOs in context which you cannot clear. In this instance USING thisBO ensures that only one is passed to the process.
Last edited by PointsWell on Wed Dec 11, 2019 8:12 am, edited 1 time in total.
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Questions about calling a process with USING

Post by Jaymer »

Oh, I've had that happen just recently.
I was having two RegularUser contexts going into a process and it was a pain... the LoggedIn one is 1, and that user selected another User from a list, that was 2nd one. I didn't want both being passed in.
I'll have to check that out. Thx
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Questions about calling a process with USING

Post by aware_support »

The most typical usage of USING is when you want to pass a value of a reference attribute (which is obviously not in Context):

MyProcess USING SomeObject.ReferenceAttribute

Another scenario is when you have several instances of the object declared as process input in Context. In this case what gets passed to the process automatically is undefined - Aware IM picks one at random. If you use USING you can specify a specific instance:

MyProcess USING ThisInputObject
Aware IM Support Team
Post Reply