• 0 Vote(s) - 0 Average
  • 5
  • 4
  • 3
  • 2
  • 1
Thread Modes

Business Rule - variables
#1
Hello,

We want to use a BR in a loop whenever there's a specific condition.
It's possible to update the variables used in the workflow?

Thank you.
pms23, proud to be a member of EV CONNECT FORUM since Apr 2017.

#2
(12-14-2018, 09:46 AM)pms23 Wrote: Hello,

We want to use a BR in a loop whenever there's a specific condition.
It's possible to update the variables used in the workflow?

Thank you.

Hello,
Yes, add a internal step with SQL like :
select external_reference from sd_request where request_id=@@ID@@

In 'Instance variables' section, define a name of variable and value type as 'variable'

SQL script must return a unique value

P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.

#3
(12-21-2018, 07:18 AM)ABBE Philippe Wrote:
(12-14-2018, 09:46 AM)pms23 Wrote: Hello,

We want to use a BR in a loop whenever there's a specific condition.
It's possible to update the variables used in the workflow?

Thank you.

Hello,
Yes, add a internal step with SQL like :
select external_reference from sd_request where request_id=@@ID@@

In 'Instance variables' section, define a name of variable and value type as 'variable'

SQL script must return a unique value

P.ABBE

The situation with variables is solved.

The problem is in the 'send notification' step.

This step contains the variables collected in the workflow that, when entering in a loop, collects another type of information. For example, in the first interaction it collects the REQUEST_ID 2585 and in the second interaction it collects the REQUEST_ID 2586. In the notification to the user, this type of information should follow in different emails.

What happens is that the workflow effectively enters in loop and collects the variables correctly but the notification step is only done at the end.

[Image: y4m7A2FOij5VatFRkQyS1zJwKtk1Izqrh8fkTy-0...pmode=none]

Is there any way to force the notification to be sent after I have collected the variables?
pms23, proud to be a member of EV CONNECT FORUM since Apr 2017.

#4
(12-27-2018, 06:09 AM)pms23 Wrote:
(12-21-2018, 07:18 AM)ABBE Philippe Wrote:
(12-14-2018, 09:46 AM)pms23 Wrote: Hello,

We want to use a BR in a loop whenever there's a specific condition.
It's possible to update the variables used in the workflow?

Thank you.

Hello,
Yes, add a internal step with SQL like :
select external_reference from sd_request where request_id=@@ID@@

In 'Instance variables' section, define a name of variable and value type as 'variable'

SQL script must return a unique value

P.ABBE

The situation with variables is solved.

The problem is in the 'send notification' step.

This step contains the variables collected in the workflow that, when entering in a loop, collects another type of information. For example, in the first interaction it collects the REQUEST_ID 2585 and in the second interaction it collects the REQUEST_ID 2586. In the notification to the user, this type of information should follow in different emails.

What happens is that the workflow effectively enters in loop and collects the variables correctly but the notification step is only done at the end.

[Image: workflow.PNG]

Is there any way to force the notification to be sent after I have collected the variables?

Hello,
Your picture is not visible (pb with gqualidade.cm-porto.net)

"What happens is that the workflow effectively enters in loop and collects the variables correctly but the notification step is only done at the end." => Only last variable are usable

"Is there any way to force the notification to be sent after I have collected the variables?" => No

If you like to add some raw and send result in an email then you should concat each raw into a nvarchar(max) field and build a HTML tab

example : "table of assets to be returned"
Steps in the process
1/ Adding the beginning of the table
2/ Condition on material to be returned
3/ Recovery of the max asset_id
4/ Construction of a row of the table
5/ Tag of the added material
6/ Delete hardware tag
7/ End of the table
8/ End of waiting stage for construction of material to be returned
9/ End of process step

example of step 4 "Construction of a row of the table"

Code:
update SD_REQUEST set DYNAMIC_DETAILS=(
(select DYNAMIC_DETAILS from SD_REQUEST where REQUEST_ID=(select REQUEST_ID FROM AM_ACTION WHERE ACTION_ID=@@ID@@))
+'<tr><td><span style="font-family: verdana, sans-serif; font-size: 10pt;">' +
(select ASSET_TAG from AM_ASSET where ASSET_ID=#[VAR.MAX_ASSET_ID]#)
+'</span></td><td><span style="font-family: verdana, sans-serif; font-size: 10pt;">' +
(select SERIAL_NUMBER from AM_ASSET where ASSET_ID=#[VAR.MAX_ASSET_ID]#)
+'</span></td><td><span style="font-family: verdana, sans-serif; font-size: 10pt;">' +
(select AM_MANUFACTURER.MANUFACTURER from AM_ASSET
inner join AM_CATALOG ON AM_ASSET.CATALOG_ID=AM_CATALOG.CATALOG_ID
inner join AM_MANUFACTURER ON AM_CATALOG.MANUFACTURER_ID=AM_MANUFACTURER.MANUFACTURER_ID
where ASSET_ID=#[VAR.MAX_ASSET_ID]#)
+'</span></td><td><span style="font-family: verdana, sans-serif; font-size: 10pt;">' +
(select AM_CATALOG.ARTICLE_MODEL from AM_ASSET
inner join AM_CATALOG ON AM_ASSET.CATALOG_ID=AM_CATALOG.CATALOG_ID
where ASSET_ID=#[VAR.MAX_ASSET_ID]#)
+'</span></td></tr>')
where REQUEST_ID=(select REQUEST_ID FROM AM_ACTION WHERE ACTION_ID=@@ID@@)
 

P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.






Users browsing this thread: 1 Guest(s)