How to open a dialog showing a workflow view ?

Yann SELBONNE September 1, 2015

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

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Lee Alexis Bermejo February 22, 2018

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/

0 votes
Yann SELBONNE September 1, 2015

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>
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2015

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.

Yann SELBONNE September 1, 2015

Ok, so the JIRA workflow viewer is not a reusable component ? :(

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2015

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.

Yann SELBONNE September 4, 2015

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...

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 4, 2015

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)

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2015

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.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events