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)
Triggering workflow in Worksite MPwhile content uploading
Sushant
Hi All,
How to trigger a workflow in Worksite MP while uploading/adding an document.
As per the process, when a document gets uploaded, needs review and approval, for that we have defined a workflow. I am unable to integrate this workflow to document updation process.
Please some one help me out...or give me the url where I find sufficient documentation.
Thanx in advance,
Sushant Devata.
Find more posts tagged with
Comments
Migrateduser
Hello, Sushant.
I'm sorry but presently there is no trigger mechanism available to automatically start a workflow process once a document is added to a folder. We're aware of this missing feature and hope to implement it soon. In the meantime, you might be able to simulate this with the following work-around.
You can create a workflow template that brings a document through a review process and, upon successful completion, makes a copy of that document (or moves it) to a destination folder of "published" documents. Normal users should not be permitted to manually add documents to this "published" documents folder, of course. Only your workflow template should be able to do this (using a "deploying" user of sufficient rights). I know that this plan doesn't entirely follow the paradigm you're trying to implement, but I'm hoping it might come close enough.
A few notes: The act of copying/moving WOM objects (such as documents) via a workflow process implies that your workflow template will be using what's called a "Java helper class" to make WOM API calls. Making WOM calls through Java helper classes is discussed in the WorkRoute documentation.
Please let me know what you decide to do. Best of luck!
Thanks,
Nick Katsifarakis
Software Engineer
Interwoven, Inc.
Sushant
Hi Nick,
Thanx for your quick response. Currently I am thinking of making a colloborative workspace where the user can upload all the new documents. When the user wants to put these documents in the knowledge space, he will be forced to kick off a workflow which will do the reviewal and approval process. As per your reply we need to use Java helper class. I will try that.....
I dont find any other alternative to the requirement I have......
Could you please let me know once "triggering a workflow while content upload is implemented in Worksite MP" in the later versions.....
Please suggest, if any thing better than this can be done for my requirement.
Thanx again,
Sushant Devata.
Migrateduser
Since there is not yet an event mechanism to monitor the arrival of a document in a folder, what you can do is write a WF (as Nick suggested), then add a menu item to the Document Folder (eg "Document Submissions") which calls your WF to take all documents in the folder through your WF to the desired KSpace. That seems to be the most seamless option at present.
Director of Technology and Strategic Solutions, Asia-Pacific
Email:
barney.dunne@interwoven.com
Sushant
Hi Barney Dunne,
Could you please tell me how to add a menu item to the document folder.
In the view set manager - view set - Document folder - Edit Menu item - what value needs to be given in the href text box.
Could you please tell me where I can find sufficient documentation.
Do I need to give the Workflow name or what???????
sushant.
JTNeville
Adding a menu item is just writing the code, storing the file in your tomcat worksitemp folder and then updating the document or page decoration file. There is a step by step example in the Administration or UI Customization doc's (I forget which) available at the HelpDesk site. I'll look around, I'm sure I have the files here somewhere and will make them available on my server soon as I get the chance for those without HelpDesk access.
Sushant
Hi Nick,
I have created a Java Helper Class to interact with the WOM api.
My Java class:
import com.imanage.cms.api.workteam.SessionManager;
import com.imanage.cms.api.workteam.SimpleSession;
public class Sample{
public static String applicationName = "";
public static String serverName = "";
public static void main(String args[]){
try{
System.out.println("Creating Session Manager...");
SessionManager manager = SessionManager.getInstance();
System.out.println("Session Manager created. Creating Simple Session...");
// Create a SimpleSession
SimpleSession session = manager.createSimpleSession(applicationName,serverName);
System.out.println("Create a simple session");
}catch(Exception e)
{
e.printStackTrace();
}
}
}
When I try to execute, its throwing me the following error. It seems FileOutputStream class got corrupted. Please help me out.
java.lang.ClassFormatError: com/imanage/cms/fc/io/ImFileOutputStream (Invalid start_pc/length in local var table)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at com.imanage.cms.fc.base.CmsSystem.setCMSDirPath(CmsSystem.java:568)
at com.imanage.cms.fc.base.CmsSystem.<clinit>(CmsSystem.java:528)
at com.imanage.cms.t2.jom.impl.PoolManager.<init>(PoolManager.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.imanage.cms.fc.base.CmsSingleton.newInstance(CmsSingleton.java:412)
at com.imanage.cms.fc.base.CmsSingleton.getInstance(CmsSingleton.java:173)
at com.imanage.cms.fc.base.CmsSingleton.getInstance(CmsSingleton.java:149)
at com.imanage.cms.t2.jom.impl.PoolManager.getInstance(PoolManager.java:29)
at com.imanage.cms.t2.jom.SessionManager.<init>(SessionManager.java:351)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.imanage.cms.fc.base.CmsSingleton.newInstance(CmsSingleton.java:412)
at com.imanage.cms.fc.base.CmsSingleton.getInstance(CmsSingleton.java:173)
at com.imanage.cms.fc.base.CmsSingleton.getInstance(CmsSingleton.java:149)
at com.imanage.cms.t2.jom.SessionManager.getInstance(SessionManager.java:38)
at com.imanage.cms.api.workteam.SessionManager.<init>(SessionManager.java:120)
at com.imanage.cms.api.workteam.SessionManager.getInstance(SessionManager.java:111)
at com.interwoven.worksite.KM.CreateDocument.main(CreateDocument.java:15)
Exception in thread "main"
Sushant
Hi Neville,
Could you please let me know, where I can find the documentation regarding adding a menu item.
I am unable to find any where.
sushant.
Migrateduser
Hello, Sushant!
I'm not quite certain why you're getting the error you've described to me. But I can tell you that we make available a base helper class that you can extend from which will provide you with workspace, library and session information. (Granted, all of this is done through an EnterpriseSession, not a SimpleSession.) Can I propose that you try again with a helper class that extends the base class?
Instructions are available in the WorkRoute documentation (from Template Designer or Forms Manager help). However, to help get you started quickly, I'll provide some sample code.
The class you'll need to extend is called JavaScriptHelperBase. It's in the package com.imanage.cms.t2.workflow.engine.javascripthelper.
Then, you should override a method called doExecute as shown below:
public class Sample extends JavaScriptHelperBase
{
protected Object doExecute(Object input) throws WorkflowException
{
try
{
Workspace workspaceProcessIsRunningIn = getWorkspace();
// from this workspace, you can get library, session and other things....
}
catch (Exception e)
{
throw new WorkflowException(e);
}
return null; // or whatever you might want to return...
}
}
When you instantiate this class in your JavaScript, you'll want to call the execute method. Again, I'll refer you to the documentation. Look in the appendix for calling WOM methods.
All the best,
Nick
JTNeville
Page 14 in this 3.1 PDF about adding a menu bar. I'm sure there is a 4.x document I just don't have them here.
http://portal.vindicoretail.com:8080/docs/mp31UICustomization.pdf
Edited by JTNeville on 02/18/05 02:32 PM (server time).