Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using this SDK to generate CWL Documents #96

Open
MyleneSimon opened this issue Sep 8, 2022 · 5 comments
Open

Using this SDK to generate CWL Documents #96

MyleneSimon opened this issue Sep 8, 2022 · 5 comments

Comments

@MyleneSimon
Copy link

Can this SDK be used to generate CWL documents?
We are trying to add a CWL exporter to our project (we have our workflows stored in a custom format) and since we have a Java backend, I was hopping that we could use the classes generated in this SDK to create the documents and then export them in YAML. However I don't see any setters in the generated classes, or constructors that I could use to export our definitions into CWL CommandLineTool, Workflow, etc. Am I missing something?
I also tried to use schema-salad to re-generate the Java classes but couldn't find the option to generate the classes differently.

@mr-c
Copy link
Member

mr-c commented Sep 8, 2022

Hello @MyleneSimon !

The other SDKs generated using schema-salad support creating and saving, but we didn't get around to adding that to the Java templates yet.

If you are interested in adding that functionality then I can set up a meeting and walk you through the templates.

I'll probably try to enlist @ZimmerA as he implemented those features for the Typescript codegen.

@MyleneSimon
Copy link
Author

Hi @mr-c !
I can give it a try. I am looking at the schema-salad repo, it looks like I could get started modifying java_codegen.py to add the setters and constructors.
I also see unimplemented Saveable interface/class, is that meant to write to file, or something else?

@mr-c
Copy link
Member

mr-c commented Sep 8, 2022

Great to hear your enthusiasm!

I would look at the Typescript and Python implementations for hints, along with

https://common-workflow-lab.github.io/cwl-ts-auto/

https://cwl-utils.readthedocs.io/en/latest/autoapi/cwl_utils/parser/cwl_v1_2/index.html

https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/cwl_v1_2.py

And common-workflow-language/schema_salad#303 by the original Java implementor @jmchilton may provide inspiration as well. (But don't feel that you have to do it all, any improvement is welcome!)

@MyleneSimon
Copy link
Author

Just to give a quick update, I added some minimal changes that add the generation of setters and default constructors, it looks like it is enough in our project to be able to generate CWL documents (which we serialize with Jackson). I will test a bit more and push a PR (hopefully some time next week).

@mr-c
Copy link
Member

mr-c commented Oct 5, 2022

That's great news @MyleneSimon , thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants