Page 1 of 1

VLF-ONE "Sub" Command

Posted: Wed Nov 07, 2018 2:45 am
by jyoung
I am trying to figure out how to get this to work in VLF-ONE. I have an idea, but want to see if there is a better approach.
I also feel like I have already asked this but for life of me I can't find it. If I have please forgive the incompetence.

I have a business object that will have about 10 command handlers associated with it (only two are shown below). The problem is that some of these commands are really complex and should themselves be broken down into "sub" commands.
Capture.PNG
Capture.PNG (13.94 KiB) Viewed 2099 times
With the exception of the "Summary" all these "sub" commands have their own load/save logic, each being a different "aspect" of an Associate. Each "sub" command is a View inside a ViewContainer controlled by a Menu.

The problem comes up when trying to invoke command based functionally in a child component. For example, queuing an async operation, or executing that operation.

My idea was to create a "Base" View that all the other views would extend and use that base to hold a reference to the actual command and a reference to the Associate instance from the instance list.

Code: Select all

begin_com role(*EXTENDS #PRIM_VIEW) displayposition(1) tabposition(1)

define_com class(#VF_AC010O) name(#Command) reference(*DYNAMIC)
define_com class(#ASCSRHAssociate) name(#Associate) reference(*DYNAMIC)

define_pty name(Command) get(*REFERENCE #Command) set(*REFERENCE #Command)
define_pty name(Associate) get(*REFERENCE #Associate) set(*REFERENCE #Associate)
end_com
Then my sub commands could use the this command to trigger command functionality. I can't use async queue functionality because that requires the avExecuteAsyncOperation to be redefined, but I can use avGoToBusyState, etc.

I can set those properties from my command as such

Code: Select all

mthroutine name(uExecute) options(*REDEFINE)

if ((#SwitchCallerReference *IsNot *NULL) *And (#SwitchCallerReference *Is #ASCSRHAssociate))
#Associate <= #SwitchCallerReference *As #ASCSRHAssociate
else
#avFrameworkManager.avIssueMessage autoclear(False) requester(#COM_OWNER) text("Missing Current Associate")
endif

endroutine

evtroutine handling(#ViewContainer.ActiveViewChanged)
#CurrentView <= #ViewContainer.ActiveView *As #MGSCommandView
#CurrentView.Command <= #COM_OWNER
#CurrentView.Associate <= #Associate
endroutine
Its not ideal but I think it could work. What I would really like is to have a Business Object WITHOUT an Instance List. That way I could model the "Details" command as a Details Business Object.

Any thoughts on how to better handle this?

Thanks,
Joe

Re: VLF-ONE "Sub" Command

Posted: Wed Nov 07, 2018 8:49 am
by MarkDale
You can have a business object with no instance list simply by removing all the filters and defining the commands in the business object as "business object command" instead of "instance command".

There is also a common activity for a business object to "Make this a one command, no instance list, business object" (in VLF epc142011)

Re: VLF-ONE "Sub" Command

Posted: Wed Nov 07, 2018 9:02 am
by jyoung
Hmm. How did I miss that ... ?

That I think will solve a few issues I am running into. Will try it and get back to you.

Thanks!
Joe