Create linear (single transaction) process with ReFramework using queue data

Hello,

I have a single transaction process which I am having difficulty with. I have tried changing GetTransactionData.xaml within Reframework but receiving an error.

This post Set transaction data for linear process said to set out_TransactionItem = 1
I tried that but UiPath is throwing “Value of Type Integer cannot be converted to UiPath.Core.Queue item” error.

Within GetTransactionData.xaml I have an if activity which is set to (if):
in_TransactionNumber = 1

Assign: out_TransactionItem Value: 1

How can i fix without changing reframework states? I need to keep GetTransactionItem.xaml

Thank you

@Newbie_23

check this

cheers

Hi

The error “Value of Type Integer cannot be converted to UiPath.Core.Queue item” means that you are trying to assign an integer value to a variable of type UiPath.Core.QueueItem. This is not possible because the two types are not compatible.

To fix this error, you need to cast the integer value to a UiPath.Core.QueueItem type. Casting is the process of converting one data type to another.

To cast the integer value to a UiPath.Core.QueueItem type, you can use the following code:

out_TransactionItem = new UiPath.Core.QueueItem(in_TransactionNumber.ToString());

Where out_TransactionItem is of type UiPath.Core.QueueItem type

The new keyword is used to create a new instance of an object. The UiPath.Core.QueueItem() constructor takes a string value as input and creates a new UiPath.Core.QueueItem object from the string value.

Once you have cast the integer value to a UiPath.Core.QueueItem type, you can then assign it to the out_TransactionItem variable.

An updated version of your GetTransactionData.xaml workflow:

 If
    * in_TransactionNumber = 1
    * Assign
        * Value: new UiPath.Core.QueueItem(in_TransactionNumber.ToString())
        * To: out_TransactionItem
End If

This code will cast the value of the in_TransactionNumber variable to a UiPath.Core.QueueItem type and assign it to the out_TransactionItem variable. You can then use the out_TransactionItem variable in your linear process.

Note: You do not need to change any of the Reframework states to fix this error.

Cheers @Newbie_23

I have tried to implement but now receiving a new error:
“Compiler error encountered processing expression new UiPath.Core.QueueItem(in_TransactionNumber.ToString) too many arguments to Public sub new”

Could you help me @Palaniyappan ?

@Newbie_23

try this way, why to change the datatype of out transaction item

in then part assign what ever value you want to pass

cheers

1 Like

Hello,

I do not want to change the type. I would like to keep it as a queue item

@Newbie_23

i have not changed the data type can you check it once

in_TransactionNumber is of int32 datatype

out_Transactionitem is queue item

ok but i cannot see anything within the ‘Then’ assign within your picture? Its just blank

@Newbie_23
pass what you want to pass in that assign activity which is placed in the then part

cheers

Yes, I understand that that where the solution should go… i don’t know what the solution is though

@Newbie_23

can you explain what was your scenario and what you are actually expecting

If you want a linear single-item process, REFramework is not the thing to use.

Hi @Newbie_23

Go through this Link it will solve your Issues

@Newbie_23

Can you please let us know the requirement properly…

You need a linear process or a queue based?

What do you mean by queue based linear? …do you mean you have only one queue item?

If yes then you need not do any change as there is only one item REF will work only once

If you need linear process follow the steps

Cheers

I like this solution but cannot get to work. @ppr do you know how to fix?

If
* in_TransactionNumber = 1
* Assign
* Value: new UiPath.Core.QueueItem(in_TransactionNumber.ToString())
* To: out_TransactionItem
End If

Receiving error:
“Compiler error encountered processing expression new UiPath.Core.QueueItem(in_TransactionNumber.ToString) too many arguments to Public sub new”

1 Like

Just a workaround I would say
Use Add To Queue and provide the in_transactionNumber as ItemInformation

Then retrieve this element As queue item

@Newbie_23

Unable to use Add to Queue as this process does not have a queue of its own. It is reading from multiple queues within Process.xaml

May be can we create one @Newbie_23

When you mentioned casting the integer value to a UiPath.Core.QueueItem type, is there no way to fix that code to assign an int / string to a queue item directly to hold it locally?

I tried either it didn’t work
I think I m missing some syntax
@Newbie_23