Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-studio
Commits
24a7a971
Commit
24a7a971
authored
Nov 03, 2015
by
Romain Bioteau
Browse files
BS-14537
Export document list instead of simple document
parent
eddb1dd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
bundles/plugins/org.bonitasoft.studio.engine/src-test/java/org/bonitasoft/studio/engine/export/EngineExpressionUtilTest.java
View file @
24a7a971
...
...
@@ -33,6 +33,7 @@ import org.bonitasoft.studio.model.process.Data;
import
org.bonitasoft.studio.model.process.Document
;
import
org.bonitasoft.studio.model.process.ProcessFactory
;
import
org.bonitasoft.studio.model.process.builders.BusinessObjectDataBuilder
;
import
org.bonitasoft.studio.model.process.builders.DocumentBuilder
;
import
org.eclipse.emf.ecore.EObject
;
import
org.junit.Test
;
...
...
@@ -66,6 +67,24 @@ public class EngineExpressionUtilTest {
.
hasExpressionType
(
ExpressionType
.
TYPE_DOCUMENT
.
name
());
}
@Test
public
void
should_createExpression_document_list
()
throws
Exception
{
//given
final
Expression
studioExpression
=
createStudioExpression
(
"document1"
,
"document1"
,
List
.
class
.
getName
(),
ExpressionConstants
.
DOCUMENT_TYPE
);
studioExpression
.
getReferencedElements
().
add
(
DocumentBuilder
.
aDocument
().
multiple
().
build
());
//when
final
org
.
bonitasoft
.
engine
.
expression
.
Expression
engineExpression
=
EngineExpressionUtil
.
createExpression
(
studioExpression
);
//then
EngineExpressionAssert
.
assertThat
(
engineExpression
)
.
hasName
(
"document1"
)
.
hasContent
(
"document1"
)
.
hasReturnType
(
List
.
class
.
getName
())
.
hasExpressionType
(
ExpressionType
.
TYPE_DOCUMENT_LIST
.
name
());
}
@Test
public
void
should_createExpression_constant
()
throws
Exception
{
//given
...
...
bundles/plugins/org.bonitasoft.studio.engine/src/org/bonitasoft/studio/engine/export/EngineExpressionUtil.java
View file @
24a7a971
...
...
@@ -407,6 +407,13 @@ public class EngineExpressionUtil {
return
createPatternExpression
(
expressionBuilder
,
expression
);
}
if
(
ExpressionConstants
.
DOCUMENT_TYPE
.
equals
(
type
))
{
final
EList
<
EObject
>
referencedElements
=
expression
.
getReferencedElements
();
if
(!
referencedElements
.
isEmpty
())
{
final
Document
document
=
(
Document
)
referencedElements
.
get
(
0
);
if
(
document
.
isMultiple
())
{
return
createDocumentListExpression
(
expressionBuilder
,
expression
);
}
}
return
createDocumentExpression
(
expressionBuilder
,
expression
);
}
if
(
ExpressionConstants
.
DOCUMENT_LIST_TYPE
.
equals
(
type
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment