Put your jar files in: /iw-home/local/config/lib/content_center/customer_src/libPut your class files in:/iw-home/local/config/lib/content_center/customer_src/srcBe in the directory:/iw-home/local/config/lib/content_center/customer_srcand run /iw-home/bin/make_toolkit.iplIn your workflow model, if you are using external task, put the following in command:/iw-home/tools/java/bin/java -cp classpath package.classnamereplace the classpath with your classpath, replace the package.classname with your package.If you are using url external task, your uri should be:http://$IW_SERVER/iw-cc/urlexternaltaskThen add a ClassName variable and have it point to your package.classname.
hi,allnow, i am using the external task in wf, but i need to pass parameters to the java class, such as task attach files name. if i define it under external task variable, then how to call these variable in java class?
java.lang.String getVariable(java.lang.String name) Gets custom variable of the task.
CSAreaRelativePath[]
getFiles()
CSFile[]
getFiles(java.lang.String query)
hiyou can pass any parameter by defining a task varibale (in your case it's an external task variable)To get the value of that variable in you java class use the method java.lang.String getVariable(java.lang.String name) Gets custom variable of the task. of the class CSTask, using its object.Same class you have to use in order to get the file attached to the task.use the either of these two methods as per your requirement CSAreaRelativePath[] getFiles() Gets files attached to the task. CSFile[] getFiles(java.lang.String query) Gets files attached to the task, and fetch data specified in the query for the files. Steps:Create the java classget the WF instanceget the Tasks List,identify your task(external task) by its nameImplement the required methods.Read the CSSDK docs for more information.HTH
hi, jcseto get WF instance i need to pass workflow id, can i get the currently workflow object also task,and files directly not by passing variable?and all those methods under CSTask class seems havn't implemented yet,so i need to implement them such as getVariable(), getFiles(),right?thx
public void execute(CSClient client, CSExternalTask currentTask, Hashtable params) throws CSException {.........}
CSWorkflow job = currentTask.getWorkflow();
HiI think i have not communicated you properly.I mean to say,the class you will call on your External Task will have an execute method,like public void execute(CSClient client, CSExternalTask currentTask, Hashtable params) throws CSException {.........} using this object you can also get workflow object using the method CSWorkflow job = currentTask.getWorkflow(); Now you have your currentTask object,use this to call earlier mentioned methods.
public void execute(CSClient client, CSExternalTask currentTask, Hashtable params) throws CSException { }
thanks very much, you mean under public void execute(CSClient client, CSExternalTask currentTask, Hashtable params) throws CSException { } we can use currentTask directly to get related information such as workflow instance. we needn't pass parameter pre defined in external task variable such as workflow id to get workflow then currentTask and attach files
of-course and that is what i want to communicate.
You probably need something along these lines (see code below). Make a note that the execute method gets executed automatically when your "external" task gets invoked.[html]public class MyExternalClass implements CSURLExternalTask {public void execute(CSClient client, CSExternalTask currentTask, Hashtable params) throws CSException {// you can do stuff like: currentTask.someMethodFromTheAPI(); // look at the API for available methods...// whatever processing that you want to do...// finally transition: currentTask.chooseTransition("", ""); }}[/html]HTH!
Hi sanoboyvpatel has putted you on the right track.check the note mentioned by him.As per my understanding of your requirement , now it's your turn to sort out the issue.Best of Luck
hi,allthx for your help very much. But now the issue is when call the external class it only call the main(), it didn't call the execute() though i implemented the class as you mentioned. Since this is a native method, why execute() can't be called automatically? attach the code, is there anything wrong?
Points need to know . Have you placed your java file at proper location mentioned earlier in the post.Have you run make_toolkit.iplWhat is coming in the log file iwutild_cmdout.log and servletd_out.log Note:There is no need of implementing main method in your class,execute method is called automatically whenever ur external task is invoked..
Hi, I am also facing the same problem. If i call a java file with a main method it is executing but whenever i call a file without main and with a execute method my java file is not getting called. I have placed my file in the following location : C:\Interwoven\TeamSite\local\config\lib\content_center\customer_src\src\com\corp\customi have complied it and ran make_toolkit.iplbut the file(with execute method) is not getting called. But with the same steps i can call a java file(with main method)Can anybody please help me out with this problem?
/iw-home/local/config/lib/content_center/customer_src
HiThe location is correct,but i am confused for : Are you guys are placing Java file or Class file at the location.We have to place Java file not the Class fileFrom where you are running the build,as mentioned earlier build should be run from the /iw-home/local/config/lib/content_center/customer_src As the correct procedure has been told you and it has been implemented and working for many people.
as mentioned, in externalTask command, we define the java class path. as general, .java is under xx_src while .class is under xx_outso we define java class path as $IW-HOME/../customer_out/src com.xx.xx this defination should be ok,right?But still java.lang.NoSuchMethodError:main if we don't define main() under java classis there other case cause this issue?
$IW-HOME/../customer_out/src com.xx.xx
$IW-HOME/../customer_src/src com.xx.xx
Instead of this $IW-HOME/../customer_out/src com.xx.xx it should be $IW-HOME/../customer_src/src com.xx.xx You need not to compile and place Class file at xx_out.When you run build,it will send the class to its desired location.
No, i only put the .java under customer_src,then after build, the .class will be generated under customer_out automatically.so under ExternalTask command we should define class path like:$IW-HOME/../customer_out/src com.xx.xx (.class file not .java class)the main issue is can't call execute() method now
ok, let me setup and test it at my end.then i will let you know the solution probably.