我们在 jira 中开发了一个插件,我们正在使用 osworkflow 来定义我们自己的自定义工作流。我们的插件在 jira 中工作,当我尝试初始化工作流程时,我们在 jira.log 中收到此错误
Caesium-1-3 错误 ServiceRunner
[cajira.workflow.DefaultOSWorkflowConfigurator] 拒绝使用不安全的工作流函数/类:com.service.workflow.condition.PermissionCondition
。com.atlassian.jira.security.LegacyJiraTypeResolver.WARN_ONLY.enabled
您可以通过向Jira 添加深色功能标志来启用此类的使用 。仅当您确定其已知且安全的情况下才执行此操作。这将使 Jira 容易受到潜在的攻击。
并打印以下异常
[INFO] [talledLocalContainer] com.opensymphony.workflow.WorkflowException:无法在 com.opensymphony.workflow.AbstractWorkflow.passesCondition(AbstractWorkflow.java:1045) [INFO] [talledLocalContainer] 处加载条件 [INFO] [talledLocalContainer]。 opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1083) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1107) [INFO] [talledLocalContainer] at com.opensymphony.workflow。 AbstractWorkflow.canInitialize(AbstractWorkflow.java:862) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:598)
我们的 osworkflow.xml 文件是
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
<initial-actions>
<action id="1" name="Distribute">
<meta name="addon.i18n.submit">com.form.distribute</meta>
<meta name="addon.i18n.title">com.form.distribute</meta>
<meta name="addon.description">com.form.distribute</meta>
<meta name="addon.dist.status.id">1</meta>
<meta name="addon.dist.user.status.id">1</meta>
<restrict-to>
<conditions>
<condition type="class">
<arg name="permission">HAS_DISTRIBUTION_PERMISSION</arg>
<arg name="class.name">com.service.workflow.condition.PermissionCondition</arg>
</condition>
</conditions>
</restrict-to>
<results>
<unconditional-result old-status="null" status="Open"
step="1">
<post-functions>
<function type="class">
<arg name="class.name">com.service.workflow.function.form.DistributeForm</arg>
</function>
<function type="class">
<arg name="class.name">com.service.workflow.function.form.AssignToReviewer</arg>
</function>
<function type="class">
<arg name="class.name">com.service.workflow.function.form.SendFormActionMail</arg>
<arg name="mail.action">1</arg>
</function>
</post-functions>
</unconditional-result>
</results>
</action>
</initial-actions>
<common-actions>
<action id="21" name="Distribution Close">
<meta name="addon.i18n.submit">com.form.distribution.user.close</meta>
<meta name="addon.i18n.title">com.form.distribution.user.close</meta>
<meta name="addon.description">com.form.response.close.confirmation.message</meta>
<meta name="addon.user.action">false</meta>
<results>
<unconditional-result old-status="Open" status="close" step="-1">
<post-functions>
<function type="class">
<arg name="class.name">com.service.workflow.function.form.DistributionUserClose</arg>
<arg name="status">3</arg>
</function>
</post-functions>
</unconditional-result>
</results>
</action>
</common-actions>
<steps>
<step id="1" name="Open">
<actions>
<common-action id="21" />
<common-action id="22" />
<common-action id="5" />
<common-action id="2" />
</actions>
</step>
<step id="3" name="Re-Opened">
<actions>
<common-action id="5" />
<common-action id="2" />
<common-action id="21" />
<common-action id="22" />
</actions>
</step>
</steps>
</workflow>