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 (61.8k●3●36●43)
| 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 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
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!
>then you should host those images as an URI not an URL
can someone describe the difference
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)
![]() 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
|
![]()
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 |
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.