Code re-usability

Hello,

I wish to add one function for the script in workfusion studio and can reuse them whenever needed. Like if i have to do the same process for more recordings then i will just call that function and i dont need to code the same lines again. Please advise me how to achieve this scenario.

Thank you.

Hi @dhaval_ka,

Yes, you can use include-config plugin for it:

<?xml version="1.0" encoding="UTF-8"?>

    <config charset="UTF-8">

        <include-config code="bot-config-unique-identifier"/>

    </config>

Example:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config"
	scriptlang="groovy">

	<robotics-flow>
		<robot driver="universal" close-on-completion="true"
			start-in-private="false">
			<capability name="SEARCH_ALL_WINDOWS" value="true" />
			<capability name="CLOSE_ALL_WINDOWS" value="false" />
			<script><![CDATA[
				import com.workfusion.studio.rpa.recorder.api.*
				import com.workfusion.studio.rpa.recorder.api.types.*
				import com.workfusion.studio.rpa.recorder.api.custom.*
				import com.workfusion.studio.rpa.recorder.api.internal.representation.*



				enableTypeOnScreen()


				openAndFocus("calc", 5000, 300)
			]]></script>
		</robot>
	</robotics-flow>
 <include-config  code="Untitled-248_bot_task"/>


</config>

Can you be more specific:
1)How to include this plugin ?
2)Can you provide me with one running bot ?

Thank you.

Here is an example of a bot task with include-config plugin

notepad_bot_task.zip (696 Bytes)

included config: calculator_bot_task.zip (823 Bytes)

Hi @ashapkina ,

I have a recording where i had used some actions to perform the task.
I have to use the same actions again at other place in that recording in studio.Please help me

Thanks in advance.
Regards,
Ravikumar

The only way is to copy the actions and paste where you need to reuse them.