2 Replies Latest reply on Apr 28, 2017 3:44 AM by roschatz

    Required inputs not satisfied

    roschatz

      Hello,

       

      I have a problem while developing my own forge-(scaffolding-)addon. Following the forge-tuturial 'Hands on lab' I wrote some commands like this:

       

      /**
       * Only for testing the correct injection of the command argument.
       */
      public class GerpTestCommand extends AbstractProjectCommand {
      
          @Inject
          @WithAttributes(label = "dbTable", description = "DB-Table with multi-lang-col-support", required = true)
          private UIInput<String> dbTable;
      
          @Inject
          private ProjectFactory projectFactory;
      
      
          @Override
          protected ProjectFactory getProjectFactory() {
              return projectFactory;
          }
      
      
          @Override
          protected boolean isProjectRequired() {
              return true;
          }
      
      
          @Override
          public UICommandMetadata getMetadata(final UIContext context) {
              return Metadata.forCommand(GerpAddMultiLangColsToEntityCommand.class).name("Gerp: test")
                      .category(Categories.create("test"));
          }
      
      
          @Override
          public void initializeUI(final UIBuilder builder) throws Exception {
              builder.add(dbTable);
          }
      
      
          @Override
          public Result execute(final UIExecutionContext context) throws Exception {
              
              //Do something.
              
              return Results.success("DB-table was " + dbTable.getValue());
          }
      
      }
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

       

      All my commands haves the problem, that after deploying my addon with 'addon-build-and-install' and executing the command on forge-console, Forge gives me always the message that 'Required inputs not satisfied' and goes to interactive mode, even when I call the command with the expected arguments.

       

      So when i execute the sample command above with '$ gerp-test --dbTable foo', I get this:

       

      forge_forum_post_required_inputs_not_satisfied.png

      My different commands itself works, what means that the execute()-Methods works as expected, when I input the command-arguments in interactive mode.

       

      Can anyone help me please?!