tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/1317-manually-execute-commandsRobotlegs: Discussion 2018-10-18T16:35:47Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-04T13:35:24Z2013-04-04T13:35:24ZManually Execute Commands<div><p>Hi mbarjawi,</p>
<p>We're in the process of rewriting the command center, and direct
command execution is definitely one of the features we're putting
in.</p>
<p>Maybe I didn't understand the problem fully, but can't you map
the commands you want to have executed in sequence to the dedicated
signal? Normally they're called in order.<br>
Or is this an async process?</p>
<blockquote>
<p>However, I faced problems when remapping the trigger Signal to
the next command, it keeps telling me that I am overriding a
mapping.. even though I am explicitly un-mapping it but it is not
working.</p>
</blockquote>
<p>I suppose the unmapping happens in the executed command, right?
I seem to remember this wasn't fixed yet in the current
implementation of the signalCommandMap, but it definitely will
be.<br>
Anyway, it's only a warning, nothing will explode, so you can
safely ignore the warning until we've got the command center
finished and the signalcommandmap updated.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-04T15:27:30Z2013-04-04T15:27:30ZManually Execute Commands<div><blockquote>
<p>We're in the process of rewriting the command center, and direct
command execution is definitely one of the features we're putting
in.</p>
</blockquote>
<p>That's great!!... looking forward for it.</p>
<blockquote>
<p>Maybe I didn't understand the problem fully, but can't you map
the commands you want to have executed in sequence to the dedicated
signal? Normally they're called in order. Or is this an async
process?</p>
</blockquote>
<p>Originally, my plan is to start a bootstrap extension now with
the basic features that I need right away, and continue to develop
it whenever I need more features in it later on.</p>
<p>So the current need for my software is to call the configuration
commands in sequence. I didn't know that I can map multiple
commands to the same signal... thanks for sharing the information.
Which brings me to the question: is there a documentation for RL2
that explains all of its features...</p>
<blockquote>
<p>I suppose the unmapping happens in the executed command, right?
right</p>
<p>Anyway, it's only a warning, nothing will explode</p>
</blockquote>
<p>You are right... however, I have then to modify the MVCSBundle
and remove the VigilanceExtension which keeps giving errors for
warnings. I didn't want to change anything in RL2's original
code... but I guess its a temporary solution until things are
fixed.</p>
<p>Thanks for all the efforts you guys are doing. Thanks for
Robotlegs, the best toolkit I've seen so far. I wish I can help in
it one way or another.</p></div>mbarjawitag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-05T05:30:20Z2013-04-05T05:30:20ZManually Execute Commands<div><blockquote>
<p>So the current need for my software is to call the configuration
commands in sequence.</p>
</blockquote>
<p>If I'm not mistaken that's what the config classes are meant for
to setup the wiring and configuration. Or are you talking about
creating an async bootstrapping sequence that loads configuration
data from several sources?</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-06T04:02:25Z2013-04-06T04:02:25ZManually Execute Commands<div><blockquote>
<p>If I'm not mistaken that's what the config classes are meant for
to setup the wiring and configuration.</p>
</blockquote>
<p>Do you mean just a plain IConfig class that has all the
configuration inside it?</p>
<p>I don't remember exactly where, but I saw in one example online
that each group of configurations are grouped into commands... for
example, all signalCommandMap configurations (the actions) are
grouped into ConfigureActionsCommand, all behaviors are grouped in
ConfigureBehaviorsCommand...etc... and I thought that this looks a
bit more organized in stead of having a long list of all
configurations in one single file. This might not be the best way
of doing it... and I am not aware of any disadvantages of this way
of doing things.</p>
<p>So basically what I ended up doing now is something like
this:</p>
<pre>
<code>public class MyConfig implements IConfig
{
[Inject]
public var injector:Injector;
[Inject]
public var signalCommandMap:ISignalCommandMap;
public function configure():void
{
signalCommandMap.map( StartBootstrap, true ).toCommand( ConfigureActionsCommand );
signalCommandMap.map( StartBootstrap, true ).toCommand( ConfigureBehaviorsCommand );
signalCommandMap.map( StartBootstrap, true ).toCommand( ConfigureModelsCommand );
signalCommandMap.map( StartBootstrap, true ).toCommand( ConfigureServicesCommand );
ISignal( injector.getInstance( StartBootstrap ) ).dispatch();
}
}</code>
</pre>
<p>I'd love to hear an expert's opinion on this way of
bootstrapping things. So please don't hesitate to let me know what
you think.</p>
<p>I definitely want in the end to have a bootstrap class that
handles even async bootstrapping and handles errors and other kinds
of things... however, at this stage I figured this bootstrap class
will take a long time to build... and I am in the middle of a big
project.</p>
<p>Thanks,</p></div>mbarjawitag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-06T15:15:14Z2013-04-06T15:15:14ZManually Execute Commands<div><p>Sorry, I didn't mean to imply yours is a wrong or worse
approach. Just that you can do it with config classes if you want.
You can pass multiple config classes to the method:</p>
<pre>
<code>context.configure( ActionsConfig, BehavioursConfig, TiersConfig);
//and nest them
//TiersConfig.as
[Inject]
public var context:IContext;
context.configure(ModelsConfig, ServicesConfig, ControllersConfig, ViewsConfig);</code>
</pre></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-06T17:41:48Z2013-04-06T17:41:48ZManually Execute Commands<div><p>There wasn't any official configuration mechanism in RL1 so the
convention was to use Commands to split up configuration.</p>
<p>RL2, on the other hand, has a built-in configuration mechanism,
which is now the preferred way to split things up.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/262100672013-04-07T15:55:50Z2013-04-07T15:55:50ZManually Execute Commands<div><p>You are right... it seems more logical to place them in
configuration files instead of commands.</p>
<p>Thanks for all your replies and all the help.</p></div>mbarjawi