Skip to content

Commit

Permalink
fix dataspace composer (#3029)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannanGao-gs authored Aug 21, 2024
1 parent 9e2a29b commit e094f86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ else if (executable instanceof DataSpaceTemplateExecutable)
private static String renderDataspacePackageableElementExecutable(DataSpacePackageableElementExecutable executable, PureGrammarComposerContext context)
{
return getTabString(2) + "{\n" +
(executable.id == null ? "" : (getTabString(3) + "id: " + executable.id + ";\n")) +
(getTabString(3) + "title: " + convertString(executable.title, true) + ";\n") +
(executable.description != null ? (getTabString(3) + "description: " + convertString(executable.description, true) + ";\n") : "") +
getTabString(3) + "executable: " + PureGrammarComposerUtility.convertPath(executable.executable.path) + ";\n" +
getTabString(3) + "executable: " + executable.executable.path + ";\n" +
(executable.executionContextKey != null ? getTabString(3) + "executionContextKey: " + convertString(executable.executionContextKey, true) + ";\n" : "") +
getTabString(2) + "}";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,14 @@ public void testDataspaceExecutableTemplate() throws JsonProcessingException
" \"executable\": { \"path\": \"model::MyExecutable\" }\n" +
" },\n" +
" {\n" +
" \"_type\": \"dataSpacePackageableElementExecutable\",\n" +
" \"title\": \"Executable 3\",\n" +
" \"id\": \"2\",\n" +
" \"description\": \"description\",\n" +
" \"executable\": { \"path\": \"domain::COVIDData_QueryFunction():TabularDataSet[1]\" },\n" +
" \"executionContextKey\": \"INT\"\n" +
" },\n" +
" {\n" +
" \"_type\": \"dataSpaceTemplateExecutable\",\n" +
" \"id\": \"1\",\n" +
" \"title\": \"Template 1\",\n" +
Expand Down Expand Up @@ -734,6 +742,13 @@ public void testDataspaceExecutableTemplate() throws JsonProcessingException
" executable: model::MyExecutable;\n" +
" },\n" +
" {\n" +
" id: 2;\n" +
" title: 'Executable 3';\n" +
" description: 'description';\n" +
" executable: domain::COVIDData_QueryFunction():TabularDataSet[1];\n" +
" executionContextKey: 'INT';\n" +
" },\n" +
" {\n" +
" id: 1;\n" +
" title: 'Template 1';\n" +
" description: 'description';\n" +
Expand Down

0 comments on commit e094f86

Please sign in to comment.