Hello,
I'm currently working on a plug-in which need to show a graphical representation of a workflow inside a dialog box (AUI Dialog2).
I would like to do it in a velocity page.
Does anybody know how to do it ?
(I've try to get inspiration for the issue screen view workflow dialog box, but it works only through an issue-key, and I cannot rely on that, as I'm dealing with project that haven't any issue yet).
Sincerely yours
Community moderators have prevented the ability to post new answers.
For those who also come to this question from search, there is now a tutorial. Not much, but it's a start. https://developer.atlassian.com/server/jira/platform/implementing-the-jira-workflow-designer/
Thanks for your answer Nic,
But I already have access to the workflowKey and the projectKey in Java,
my main difficulty is to show the graphical workflow view inside a dialog box.
Maybe the Velocity code below could explain better what I intent to do :
<section role="dialog" id="workflow-dialog" class="aui-layer aui-dialog2 aui-dialog2-medium" aria-hidden="true"> <header class="aui-dialog2-header"> <h2 class="aui-dialog2-header-main">Always use sentence case</h2> <a class="aui-dialog2-header-close"> <span class="aui-icon aui-icon-small aui-iconfont-close-dialog"> Close </span> </a> </header> <div class="aui-dialog2-content"> #set ($projectKey = $customProject.projectKey) #set ($workflowKey = $line.getWorkflow()) <!-- What I should put here to show a graphical view of a workflow ? --> </div> <footer class="aui-dialog2-footer"> <div class="aui-dialog2-footer-actions"> <button id="dialog-close-button" class="aui-button aui-button-link"> Close </button> </div> </footer> </section>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Er, all the code that you need to write to convert the xml to a graphical view. The workflow viewer in JIRA is not a simple call out you can include.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so the JIRA workflow viewer is not a reusable component ? :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I couldn't make it work on a velocity level - you have to pull out the result in Java to make it available to velocity.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well I don't find any way to do it :( What do you mean by "you have to pull out the result in Java to make it available to velocity." ? I can make a JiraWorkflow object available to the velocity code, but I still don't know how to render its graphical representation...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The workflow object contains the workflow. In xml. If you want to turn that into a diagram, you will either have to write the code to render it, find and reuse the rendering code in the bit of JIRA that renders it, or work out where JIRA keeps the diagrams it generates and use those (It used to store images on disk in a cache but I'm not sure it still does that). In all cases, you'll need to write code to pull that out, and then make it available to velocity. (Although, you could try to render it in velocity, I don't know if that's possible)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you don't have an issue, then you'd need to read the project's workflow scheme to find out all the possible workflows and ask the user to select which one they want to see. You'll need to do that in the Java in your add-on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.