Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
TS workflow in java
mamk
Hi All,
We are using Team Site 6.1. We are looking towards changing the workflow code form Perl to Java for ease of maintenance, as our team is more comfortable working with Java than Perl.
I saw another thread with the same topic, which concludes we can call JavaScript, but how do i get reference to the fields in wft file in JavaScript. We can't use Formapi in workflow.
Please throw some light on this. Some sample workflows will be of great help.
Thanks in advance,
Mamatha.
Find more posts tagged with
Comments
reddyl
You need to recreate the workflow instantiation screen using JSP or Servlets to capture input for the workflow and then use that information to create the job specification file and instantiate the workflow.
vy8359
Any sample code of how we can call the JSP or Java Class from available_templates.cfg?
thanks,
Mamatha.
Nidhi_Agrawal
You can use this command on an ipl file ..
system("java.exe path program.java_path");
for eg.
system("c:\\j2sdk1.4.0_02\\bin\\java.exe c:\\jaacall\\Hello.java");
Even u can call a bat file from an ipl file and there u can put this command.
Classpath shud be set for that java file.
I think u can put this code in available_templates.ipl file,not vary much sure.Or can put in an ipl file which u r calling from workflow.
Nidhi..
mamk
Thanks for the reply Nidhi.
We tried to use the 'system' command from .wft but couldn't succeed.
availble_templates.cfg calls .wft file and in .wft file i tried to call .java,.bat and .ipl files. but none of them worked. any more ideas?
thanks,
Mamatha.
reddyl
If you post you .wft file and the .ipl script that is the java program then someone can in the forums can point out what you are doing wrong.
Your java class was not executed due to either it could not find the java executable or because of the CLASSPATH settings.
mamk
I am thinking of doing in another way.
When we click on 'Submit' after selecting some dcr's, the system is calling available_templates.cfg right, is there a way we can call some custom java code at that time which kicks off workflow?
any ideas?
thanks in advance.
Adam Stoller
I'm not sure what you're trying to do - but I think you're approaching this incorrectly.
available_templates.cfg is a configuration file - nothing more, nothing less - it is not "called", it is "referenced" or "parsed" against information which TeamSite already has ascertained (e.g., what command was issued, what user is issuing the command, under what role is that user logged in, and in what branch [possibly with additional path information included] did all this take place).
The wft is an XML file with, potentially, embedded Perl code - which, when all is said and done - results in a pure XML job description file which is then processed by the workflow engine to create an instanatiation of the job described therein.
You could potentially have the wft run a Perl command that then invoked a java program that somehow resulted in generating the contents of the job description file - but that seems a horribly inefficient way to go about things.
Your initial post talks about using Java instead of Perl because your developers are more comfortable with Java - then it goes on to talk about JavaScript and FormAPI - which doesn't make much sense since Java and JavaScript are two very different languages that just happen to share part of the same name (well, it was more of a marketing ploy than pure happenstance, but that's another story)
I believe the CSSDK provides some support for workflows - though I'm not sure to what extent it covers wft / instantiation.
All of this then comes back to - what are you trying to change. The wft? or the externaltask and/or cgitask scripts? The scripts are probably the most likely targets for being written in a different language and this is probably also where the CSSDK would most likely come into play too - for being able to do things like access job / task object information and perform callbacks and such.
The only way that I can think of to replace the WFT construct with Perl is to replace all of the OOTB functionality for invoking jobs with your own custom functionality for doing it - so that you would be responsible for gathering the relevant information from TeamSite (command, user, role, branch, etc) and then parse the available_templates.cfg file (no reason to change that is there?) and then render a form for gathering input (if needed) to finally instantiate the workflow object in the system.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
mamk
Thanks for the info.
you are right all i want to do is replace the perl code with Java code for rendering the form to gather the input and to create the job description file and to instantiate the job by using CSSDK.
i tried to call Java and JSP from wft file but couldn't succeed, that's why i thought of following the Customizing UI approach in which i can create a new menu item and do all the things.
dazzlad
You aren't going to be able to run java code from within a WFT instantiated by standard Teamsite functionality (without some **** awful hack).
Your custom CGI/JSP will have to open available_templates.cfg and parse it - (if you require user/branch/role/instatntion command filtering).
Assuming that your user is allowed to kick off a job the CGI/JSP would have to create an HTML form to capture any parameters to the workflow.
Then, you'd need to read the job spec and somehow merge in the information that you have captured. You do this by opening the job spec with some sort of XML parser and inserting, updating elements, or with a straight forward string search and replace.
After all this you are ready to instantiate, using the CSSDK.
Having said all this, I think what you propose is a very bad idea. I can go into more detail if you wish.....
Darren.