# Sepasoft batch script

**URL:** <https://forum.inductiveautomation.com/t/sepasoft-batch-script/89184>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [April 22, 2024, 7:59am UTC](https://forum.inductiveautomation.com/t/sepasoft-batch-script/89184 "2024-04-22T07:59:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adelaide\_Wu](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@Adelaide\_Wu](https://forum.inductiveautomation.com/u/Adelaide_Wu)\
**Post date:** [April 22, 2024, 7:59am UTC](https://forum.inductiveautomation.com/t/sepasoft-batch-script/89184/1 "2024-04-22T07:59:22Z")

</div>

Currently, I am facing a challenge with the transition expression character limit. I need to match approximately 30 conditions after the 'And End', which exceeds the character limit provided in the transition expression field. I am exploring alternative solutions to address this limitation while avoiding the use of repetitive 'UPxx.complete' statements for each condition. Therefore, I do use call script function. Ex:{script:myscriptName}

In the MES batch module\>In the recipe module\>In the transition expression.  
I do call script that under the MES script batch script part.  
and the script is

```python
def do_batch_scripts(batchParams):
	"""
	This script is called from a Batch Script Phase. Return a dictionary where the keys are parameter names to write to output parameters.

	Arguments:
		batchParams: A dictionary containing input parameters on the Script Phase.
	"""
	batchID = system.tag.readBlocking('[MES]New Enterprise/Site/Area/Process Cell/LPC_Step/Batch Details/Batch_ID')[0].value
	bqe = system.mes.batch.queue.getEntry(batchID)
	for i in range(3, 30):
		path = "/Pall_30seq/P2:UP{}.Complete".format(i)
		val = system.mes.batch.queue.getParameterValueAsString(bqe, path)
# val = system.mes.batch.queue.getParameterValueAsString('cwb', "/Pall_30seq/P2:UP5.Complete")
	logger = system.util.getLogger("myLogger")
	logger.info(("{}".format(i)+val))	
# here will write the if statement to check is all complete or not
	return True

```

but the log error is  
Caused by: com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 15, in do\_batch\_scripts TypeError: getParameterValueAsString(): 1st arg can't be coerced to com.sepasoft.production.gateway.manager.misc.BatchQueueEntry

seems do not understand system.mes.batch.queue........

Specifically, I want to understand how I can enable a batch script to recognize the completion status of steps within the same layer of the recipe sequence. But I'm not sure what kind of the data type or syntax this script can understand.

thank you all
