Representing the Workflow as diagram in RTC WI. (version 4.0)
We would like to represent the workflow of the WI in a separate tab in the workitem. We have referred to the steps stated in the link: http://jazzpractices.wordpress.com/2013/01/29/what-state-are-you-in-and-where-can-you-go/
and tried to implement the same in a script based default value and attribute of type large html but we are not able achieve the same. Please find below the script file ***************************************** dojo.provide("com.acme.providers.script.WorkflowStateScriptedCalculatedValue2"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var doDebug = true; var scriptname = "WorkflowStateScriptedCalculatedValue2"; var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("com.acme.providers.script.WorkflowStateScriptedCalculatedValue", null, { getValue: function(attribute, workItem, configuration) { debug("Start"); var workFlowState = workItem.getValue(WorkItemAttributes.STATE); debug("WorkflowState: " + workFlowState); // Adjust attachment numbers in the code below return "{{https://smtcal0004.rd.corpintra.net:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IAttachmentRestService/itemName/com.ibm.team.workitem.Attachment/112|New}}"; function debug(display){ if(doDebug){ console.log(scriptname + " " + display); } } } }); })(); ************************************** Kindly let us know where are going wrong. Thanks in advance. Sandeep Rao. |
Accepted answer
Ralph Schoon (63.3k●3●36●46)
| answered Dec 17 '13, 6:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As described in https://jazz.net/library/article/1093 Lab 5, there are several limitations. You have to use a Wiki Type attribute. You have to upload the attachments to a work item to make the preview work. You also have to make sure to get the right attachment ID to create the link.
Ralph Schoon selected this answer as the correct answer
Comments
vishnudharan manivannan
commented Dec 20 '13, 6:35 a.m.
Thanks Ralph.. We were able to get the Workflow image in the Wiki attribute.. This is a great for a start!! Brilliant article :) |
5 other answers
Hello Marie,
If you are trying to achieve you business requirement by storing the workflow Images externally, then you should host those images as an URI not an URL(All the images stored in a RTC Workitem are of URI format).
Also the Server in which you are hosting the image should expose a Public URI(No authentication mechanism should be present). if not then they will be rendered as broken link in the wiki attribute.
Hope that helps!
Thanks
Abhishek
Comments Hello All
I was trying to replicate the same scenario in which i succeeded, but when i make the attribute as read only then RTC doesnot allow me to save.
the error msg shows that not able to modify the wiki type attribute.
Is there any way to make the attribute as readonly ?
Business Justification : User should not be able to edit the wiki attribute. He should only be able to see the possible workflow transitions.
Thanks in advance.
Abhishek Kumar
sam detweiler
commented Mar 27 '15, 7:58 a.m.
Don't make the attribute read-only.. (setting on each attribute)
If you set the attribute with a calculated value provider, you should be able to make the attribute read only. At least that is how it should work. It is even suggested to do so. Because you don't want to have users edit calculated values. If it does not work, that might be a defect.
You should be able to make an attribute read-only and calculated values of attribute customization should still work. In fact, as far as I recall, this is a suggestion for calculated attributes. You don't want that to be edited by a user typically, also not in plans or queries.
Thanks for sharing!
sam detweiler
commented Apr 09 '15, 7:51 a.m.
>then you should host those images as an URI not an URL
can someone describe the difference
Abhishek Kumar
commented Apr 09 '15, 8:49 a.m.
In short URI is the identifier for the resource(in your case image) where as URL is the locator for the resource.
URI = URL + URN
http://en.wikipedia.org/wiki/Uniform_resource_identifier Hello Abhishek,
the point from the original reply on URL vs URL was that each specific image needs to be specified, NOT a generic pointer to a folder.
the technical speak here is that URL does NOT name a SPECIFIC resource, only the general (folder or path), while a URI includes the resource 'name' part.
A better post (in my opinion) would have been:
Insure that the server hosting your images allows access to them without authentication, and that each image is named completely (ie http://server/path/filename)
Geoffrey Clemm
commented Apr 09 '15, 4:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On the URI/URL question ... to avoid terminological confusion I'm going to have to be a bit "disagree"able (so apologies to the posters I'm disagreeing with :-).
showing 5 of 11
show 6 more comments
|
Hi Sandeep,
I tried to reproduce the same , below are the steps I followed. 1.Create an attribute field in task WI called "Workflow" with type as Large HTML 2. Create a "default value" in attribute customization as "script based value" 3. Added the script for the attribute and also added the same in the presentation 4. Added the attachement link as mentioned https://hostname:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IAttachmentRestService/itemName/com.ibm.team.workitem.Attachment/142 I don't see the image rendering as well. You might want to check the script again. I will come back with my findings by modifying the same. Thanks Vishnu M Comments hm.. where are u guys getting the '142' number?
from eclipse.. not the web UI. never mind
sandeep rao
commented Dec 17 '13, 12:42 a.m.
Hi Sam,
sam detweiler
commented Dec 17 '13, 5:28 a.m.
yes, I see that now.. I was using the web browser and getting a different URL string.
|
Hello All,
I succeeded in this scenario, but as I would like to implement it in a process template for multiple project area, and then exporting it in another RTC installation, I don't want to store the pictures in a workitem attachment. I would prefer using project area attachment or external resource (that we can access with a URL), so that it is not mandatory to modify the link after importing the process template. But it doesn't work. If I try the first idea, I can't find a way to access the project area attachments. If I try to access to a picture stored externally, it only displays a link, not the picture directly. For example, I use the following "wiki code" : {{http://myserver/v01/State_0_Initiate.png|New}} How can I do to display external images in a wiki attribute ? Do you have another solution for my problem ? Thank you for your help, Comments You have to store it as an attachment to a work item, as explicitly stated in the description of the workshop. The image would only be displayed if you do it that way, because the image is provided by a specific REST service.
Marie Michelin
commented Apr 08 '15, 9:15 a.m.
Thank you for your really quick answer Ralph!
I am not aware of any simple solution for this. I have shared what I know.
Marie Michelin
commented Apr 08 '15, 11:55 a.m.
Thank you for your help.
|
Hello Marie,
When you are Hosting the Image on the External application you need to make sure that the application exposes the image a Rest Service
the syntax will be as follows using JAX-RS packages:
@Path("/image")
public class ImageService {
private static final String yourImagePath = "Image Path";
@Produces("image/png")
public Response getFile() {
File file = new File(yourImagePath);
ResponseBuilder response = Response.ok((Object) file);
response.header("Content-Disposition", "attachment; filename=image_from_server.png");
return response.build();
}
}
So when you implement this logic in you external application where you would be storing the image,the URI to the image will be: https://yourservername/applicationname/image/get
Hope this Helps.
Regards,
Abhishek
|
Hello Abhishek,
Really thank you for the precision. It's really clearer for me now. Today, my images are stored on a folder on an IIS web server with a WebSphere Platform. I'm not administrator of this server and I'm not used to it. But I'll discuss with my admin to see how we could implement that. I'll suggest him to use this link : http://www.ibm.com/developerworks/websphere/techjournal/1305_gunderson/1305_gunderson.html And we'll see. Thank you for your help! Regards, Marie |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
u need to remove the '|New' from the resource URL link.
it was just to help you know which content object to put there..
com.ibm.team.workitem.Attachment/112|New}}";
To add more inputs: We have also made the WI Attribute type as Wiki and image URL "https://smtcal0004.rd.corpintra.net:9443/ccm/service/com.ibm.team.workitem.common.internal.rest.IAttachmentRestService/itemName/com.ibm.team.workitem.Attachment/112".
sorry, your comment is unclear.. do you mean it still does not work?
I thought the field needed to be Large HTML. (maybe that is what u mean by 'wiki')
if u put that URL in your web browser, does the image open properly?
Hi Sam,
It still doesnot render the image. If I put the URL in the Browser url, it will display dialog box for "Open/ Download image" and we did try with large html also and still didnot work.
Thanks again.