Skip to content

Commit

Permalink
fixing issue CloudSlang#1118
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Panuska committed Dec 16, 2018
1 parent 5cc2400 commit 4e77ac5
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions content/io/cloudslang/base/lists/add_element.sl
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,26 @@
#! Example: '7'
#! @input delimiter: The list delimiter
#!
#! @output response: 'success' or 'failure'
#! @output return_result: The new list or an error message otherwise
#! @output return_code: 0 if success, -1 if failure
#!
#! @result SUCCESS: The new list was retrieved with success
#! @result FAILURE: Otherwise
#!!#
########################################################################################################################

namespace: io.cloudslang.base.lists

operation:
name: add_element

inputs:
- list
- element
- delimiter

java_action:
gav: 'io.cloudslang.content:cs-lists:0.0.7'
class_name: io.cloudslang.content.actions.ListAppenderAction
method_name: appendElement

- list:
required: false
- element:
required: false
- delimiter:
default: ','
required: false
python_action:
script: |
list = list+delimiter+element if list else element
outputs:
- return_result: ${returnResult}
- return_code: ${returnCode}

- return_result: ${list}
results:
- SUCCESS: ${returnCode == '0'}
- FAILURE
- SUCCESS

0 comments on commit 4e77ac5

Please sign in to comment.