• Adding Workflow Links

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #15699  by cwest
 
Once a workflow is started, a variable called "path" is automatically added to the process instance. This variable acts as a link to the path for which the workflow was started. I would like to figure out how to make another variable that acts as a link to another file/folder. How can I do this? What type of variable would I need to add?

I would like to pull the class name of the path variable no matter what I do, I can't seem to get access to the "path" variable. The only reason I know that it exists is because I can see it in the workflow view of the dashboard and also the the view available for the administrators. The following Script code for process instance 223439 resulted in false which proves that the "path" variable doesn't seem to be publicly accessible:
Code: Select all
import com.openkm.api.OKMWorkflow;import com.openkm.api.*;
import com.openkm.core.*;
import com.openkm.bean.*;
import com.openkm.bean.form.*;
 
String token = JcrSessionManager.getInstance().getSystemToken();

OKMWorkflow obj = OKMWorkflow.getInstance();
obj.getProcessInstance(token, 223439).getVariables().containsKey("path");
 #16753  by cwest
 
I see the example there and I am already using similar code in an action handler to try to pull the "path" variable. My goal is really to add another variable that acts like a link just like the "path" variable. I want to make it so that when a user clicks on the variable in the Data section of the dashboard workflow view. The following screen shot shows the "path" variable that I am talking about:
Image

Once again, the only real thing I would like to know is, is it possible to add another variable that also acts like a link to a different folder (or even file)?
Attachments
Screen Shot 2012-05-29 at 9.55.07 a.m..png
Screen Shot 2012-05-29 at 9.55.07 a.m..png (13.28 KiB) Viewed 3825 times
 #16763  by jllort
 
Yes you can set a new variable obj.getProcessInstance(tXXXX).setVariable(XXXX) - I have not consult the reference and I do not remember if method is exactly with the name setVariable -and then asociate to a link form element ( data = "variable_name"). I suggest you set new variable type as new Input() class with type link.
 #16767  by cwest
 
I tried adding a variable by using the following code:
Code: Select all
Input inputLink = new Input();
inputLink.setType("link");
inputLink.setName("aLink");
inputLink.setValue("/okm:root/Unitek/PANs");
inputLink.setLabel("/okm:root/Unitek/PANs");
context.setVariable("aLink", inputLink);
After that I ran it and the following was shown in the dashboard (notice that there is no link to the PANs folder):
Screen Shot 2012-05-31 at 2.44.06 p.m..png
Screen Shot 2012-05-31 at 2.44.06 p.m..png (17.91 KiB) Viewed 3816 times
This is how it looks in the administration section:
Screen Shot 2012-05-31 at 2.43.38 p.m..png
Screen Shot 2012-05-31 at 2.43.38 p.m..png (75.63 KiB) Viewed 3816 times
Is there another type of Java object that I need to use in order to have the link appear in the dashboard?
 #16792  by jllort
 
I think you forget one step, create a form with link element and assign the new element you created where data="alink"
 #18563  by pmbsa
 
Hi, I was wondering if this question was ever really answered. I am trying to do something similar. In my form I would like to be able to point the user who is working on the task to other documents in openKM. I have tried to use an input with a type of 'link' but that doesn't do anything (besides, an input is the wrong object type for this. its more of a text element.

does anybody know if its at all possible to out a 'url' in the workflow form at all?

thanks
Paul
 #18564  by pmbsa
 
Apologies, it seems I should have simply tried the obvious which was to simple put an html href tag in the text element and it works perfectly!

thanks
Paul

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.