Submit File, Start Workflow using Java API

Options
Is there any way to Submit File, Start Workflow using Java API in Teamsite?

Comments

  • In short - yes, sort-of - though you would probably have the submit operation within the workfow itself.

     

    If you look at the CSSDK docs, you should see the CSWorkflowEngine class' createWorkflow method - but that method requires a java.lang.String `workflowSpecification - which means that you would have to decompose the workflow (WFT or WFM) into a job specification file, fill-in any variables that would normally be set within the instantiation form, and then stuff the entire thing into a String so that you can then provide it as an argurment to the createWorkflow() method.

     

    The alternative is to break out into a system call and either run iwwft_compile.ipl (WFT) or iwmodelc (WFM) - in the case of the former, you provide the instantiation parameters as an XML string fed to the command; in the case of the latter, I don't recall how (if) you provide instantiation parameters, so you're best off if you don't have any...

  • Do you mean that it is not a good way to start workflow using java code? If no, how can I get "a job specification file, fill-in any variables"? Or there is a better way to start workflow, say CLT?

  • iwwft_compile.ipl and iwmodelc are the CLTs, if you want to go that way.

     

    iwjobc might be able to help - but generally the way you get a job description file is to put the workflow into "debug" mode and have it generate the job specification file for you.

     

    If you need to programmatically fill in parameters, a reasonable way to do that is to put "tokens" (e.g.: ****_USER_****) into place within the generated job specification file, save the file as a "template" (e.g.: myjobspec.template) and then your code can read the file into a string, perform token substitution on the string, and then provide that string to the previously mentioned CSSDK method to initiate the job.

  • Thank you, it's just what I need.

TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs