Table of Contents

Class BPMProcessVO

Namespace
PHCBusinessLayer
Assembly
PHCBusinessLayer.dll

Business Process Management Type

[AttTable("BPMProcess", 20240211)]
[AttTableProducts(new Products[] { Products.BPM })]
[AttTableFlags(new TableFlags[] { TableFlags.MasterEntity, TableFlags.TableForJorge, TableFlags.FullTextSearchable })]
[AttTableOrderBy("[BPMProcess].[name]", "[BPMProcess].[grupo]")]
[AttTableVOInfo(typeof(BPMWorkflowAttInfo))]
public class BPMProcessVO : BusinessVO, IBaseSerialization, ICloneVO, ICloneable, IChange, IParent, IGenericVO
Inheritance
BPMProcessVO

Fields

CodeOnDelegate

public const string CodeOnDelegate = "OnDelegate_BPM"

Field Value

string

CodeOnEnd

public const string CodeOnEnd = "OnEnd_BPM"

Field Value

string

CodeOnInit

public const string CodeOnInit = "OnInit_BPM"

Field Value

string

CodeOnStatus

public const string CodeOnStatus = "OnStatus_BPM"

Field Value

string

Properties

GetFieldStampName

Use only field name without table name

public override string GetFieldStampName { get; }

Property Value

string

GetStampValue

public override string GetStampValue { get; }

Property Value

string

RoleVO

Instance of RoleVO, permission

[AttExternalCollection(typeof(RoleVO), new string[] { "[PF].[pfstamp]", "[BPMProcess].[pfstamp]" })]
public RoleVO RoleVO { get; }

Property Value

RoleVO

UserVO

Instance of UserVO, permission user

[AttExternalCollection(typeof(UserVO), new string[] { "[US].[usstamp]", "[BPMProcess].[usstamp]" })]
public UserVO UserVO { get; }

Property Value

UserVO

activities

User tasks or scrips

[AttCollection(typeof(BPMActionVO))]
public List<BPMActionVO> activities { get; set; }

Property Value

List<BPMActionVO>

bpmXml

XML with process drawing

[AttHidden]
public string bpmXml { get; set; }

Property Value

string

bpmprocessstamp

Unique ID

[AttLenght(25)]
public string bpmprocessstamp { get; set; }

Property Value

string

description

Description

[AttFieldType(AttFieldType.InputTypes.memo)]
public string description { get; set; }

Property Value

string

events

Events

[AttCollection(typeof(BPMEventVO))]
public List<BPMEventVO> events { get; set; }

Property Value

List<BPMEventVO>

flows

Sequences of flows between elements

[AttCollection(typeof(BPMFlowVO))]
public List<BPMFlowVO> flows { get; set; }

Property Value

List<BPMFlowVO>

gateways

Decisions

[AttCollection(typeof(BPMGatewayVO))]
public List<BPMGatewayVO> gateways { get; set; }

Property Value

List<BPMGatewayVO>

grupo

Group

[AttList]
[AttLenght(40)]
[AttMandatory]
[AttLogInfo(2)]
public string grupo { get; set; }

Property Value

string

identification

Identification

[AttVirtualField]
[AttHidden]
public string identification { get; set; }

Property Value

string

idvarname

ID variable

[AttLenght(60)]
[AttVirtualField]
public string idvarname { get; set; }

Property Value

string

idvarstamp

ID variable (code)

[AttForeignKey(typeof(BPMVariableVO))]
[AttLenght(25)]
public string idvarstamp { get; set; }

Property Value

string

inativo

Inactive

[AttList]
public bool inativo { get; set; }

Property Value

bool

name

Name

[AttList]
[AttLenght(80)]
[AttMandatory]
[AttIndex(Unique = true)]
[AttLogInfo(1)]
public string name { get; set; }

Property Value

string

ndoc

Serie

[AttLenght(5)]
[AttIndex(Unique = true)]
[AttLogInfo(0)]
[AttList]
[AttMinValue(0)]
[AttMandatory]
public int ndoc { get; set; }

Property Value

int

ondelegate

[AttFieldType(AttFieldType.InputTypes.memo)]
[AttHidden]
public string ondelegate { get; set; }

Property Value

string

onend

Código ao finalizar

[AttFieldType(AttFieldType.InputTypes.memo)]
public string onend { get; set; }

Property Value

string

Este código não tem qualquer influencia sobre o fecho e a passagem a histórico do workflow, qualquer tipo de retorno de mensagens ou erro na execução do código é ignorado, pois não é possivel cancelar o fim de um workflow, no entanto as mensagens retornadas são registradas no log do workflow.

Remarks

É o último código a correr de todo o workflow, corre depois do elemento evento de fim ter sido executado, pode usar 'SDKBPM' para facilmente aceder ao SDK do BPM e assim efetuar as operações desejadas.

Payload Se o worflow foi iniciado a partir do ecrã de clientes quando se consultava o cliente João, esses dados estão dentro do workflow através de uma variável especial e em qualquer altura da execução do workflow pode-se obter esses dados da seguinte maneira:

Dim cliente as ClVO = SDKBPM.GetPayload(Of ClVO)()

Contexto SDKBPM.GetProcess() = Tipo de workflow iniciado BPMProcessVO SDKBPM.GetWorkflow() = Workflow iniciado BPMInstanceVO SDKBPM.GetActivity() = Atividade que está a ser processada BPMActivityVO

SDKBPM.GetElement() = Elemento que deu origem á atividade BPMElement SDKBPM.GetElement(Of BPMEventVO)() SDKBPM.GetElement(Of BPMFlowVO)() SDKBPM.GetElement(Of BPMGatewayVO)() SDKBPM.GetElement(Of BPMActionVO)()

Definir valores de variáveis SDKBPM.SetVar('Cod02', 'Meu resumo inicial')

Obter valores de variáveis SDKBPM.GetVar('Cod02'), retorna Object SDKBPM.GetVar(Of String)('Cod02'), retorna String

oninit

Código ao iniciar

[AttFieldType(AttFieldType.InputTypes.memo)]
public string oninit { get; set; }

Property Value

string

Atenção, se for retornada alguma mensagem de erro 'MsgError' ou ocorrer erro na execução do código, o workflow é cancelado, todas as mensagens retornadas são registradas no log do workflow e se o evento que iniciou o workflow
tiver momento de confirmação pelo utilizador, essas mensagens também são mostradas ao utilizador.

Remarks

É o primeiro código a correr de todo o workflow, mesmo antes de correr o 'Código ao iniciar' do evento que iniciou o workflow, é a altura ideal para definir valores para as variáveis, ou alterar outras configurações do workflow ou da atividade que está a ser processada, pode usar 'SDKBPM' para facilmente aceder ao SDK do BPM e assim efetuar as operações desejadas.

Payload Se o worflow foi iniciado a partir do ecrã de clientes quando se consultava o cliente João, esses dados estão dentro do workflow através de uma variável especial e em qualquer altura da execução do workflow pode-se obter esses dados da seguinte maneira:

Dim cliente as ClVO = SDKBPM.GetPayload(Of ClVO)()

Contexto SDKBPM.GetProcess() = Tipo de workflow iniciado BPMProcessVO SDKBPM.GetWorkflow() = Workflow iniciado BPMInstanceVO SDKBPM.GetActivity() = Atividade que está a ser processada BPMActivityVO

SDKBPM.GetElement() = Elemento que deu origem á atividade BPMElement SDKBPM.GetElement(Of BPMEventVO)() SDKBPM.GetElement(Of BPMFlowVO)() SDKBPM.GetElement(Of BPMGatewayVO)() SDKBPM.GetElement(Of BPMActionVO)()

Definir valores de variáveis SDKBPM.SetVar('Cod02', 'Meu resumo inicial')

Obter valores de variáveis SDKBPM.GetVar('Cod02'), retorna Object SDKBPM.GetVar(Of String)('Cod02'), retorna String

onlyoneactive

Only one workflow active

public bool onlyoneactive { get; set; }

Property Value

bool

Remarks

It only allows you to create a new workflow of this type, when there is no workflow active, regardless of the record it is linked to.

onstatus

Código de estado

[AttFieldType(AttFieldType.InputTypes.memo)]
public string onstatus { get; set; }

Property Value

string

Se for retornada alguma mensagem de erro 'MsgError' ou ocorrer erro na execução do código, a alteração do valor do estado é cancelada mas o workflow continua em execução, todas as mensagens retornadas são registradas no log do workflow.

Remarks

Quando uma atividade altera o valor do estado do workflow este código é executado automaticamente,
permitindo assim reagir a essa alteração e poder enviar mensagens ou notificações sobre o que acabou de ocorrer ou então executar outro tipo de procedimento no workflow relacionado com a alteração do estado, pode usar 'SDKBPM' para facilmente aceder ao SDK do BPM e assim efetuar as operações desejadas.

Payload Se o worflow foi iniciado a partir do ecrã de clientes quando se consultava o cliente João, esses dados estão dentro do workflow através de uma variável especial e em qualquer altura da execução do workflow pode-se obter esses dados da seguinte maneira:

Dim cliente as ClVO = SDKBPM.GetPayload(Of ClVO)()

Contexto SDKBPM.GetProcess() = Tipo de workflow iniciado BPMProcessVO SDKBPM.GetWorkflow() = Workflow iniciado BPMInstanceVO SDKBPM.GetActivity() = Atividade que está a ser processada BPMActivityVO

SDKBPM.GetElement() = Elemento que deu origem á atividade BPMElement SDKBPM.GetElement(Of BPMEventVO)() SDKBPM.GetElement(Of BPMFlowVO)() SDKBPM.GetElement(Of BPMGatewayVO)() SDKBPM.GetElement(Of BPMActionVO)()

Definir valores de variáveis SDKBPM.SetVar('Cod02', 'Meu resumo inicial')

Obter valores de variáveis SDKBPM.GetVar('Cod02'), retorna Object SDKBPM.GetVar(Of String)('Cod02'), retorna String

pfname

Permission name

[AttLenght(60)]
[AttVirtualField(typeof(BPMWorkflowAttInfo))]
public string pfname { get; set; }

Property Value

string

pfstamp

Connection to RoleVO

[AttForeignKey(typeof(RoleVO), HiddenField = false)]
[AttLenght(25)]
public string pfstamp { get; set; }

Property Value

string

roletype

Role type

[AttLenght(2)]
public RoleTypes roletype { get; set; }

Property Value

RoleTypes

roletypename

Role type name

[AttLenght(60)]
[AttLocale(typeof(BPMWorkflowAttInfo), new string[] { "[BPMProcess].[roletype]" })]
public string roletypename { get; set; }

Property Value

string

summaryvarname

Summary variable

[AttLenght(60)]
[AttVirtualField]
public string summaryvarname { get; set; }

Property Value

string

summaryvarstamp

Summary variable (code)

[AttForeignKey(typeof(BPMVariableVO))]
[AttLenght(25)]
public string summaryvarstamp { get; set; }

Property Value

string

useattachment

Use attachments

[AttEntityAvailable(typeof(AnexosVO))]
public bool useattachment { get; set; }

Property Value

bool

useconnection

Use connections

public bool useconnection { get; set; }

Property Value

bool

usname

Permission user name

[AttLenght(60)]
[AttVirtualField(typeof(BPMWorkflowAttInfo))]
public string usname { get; set; }

Property Value

string

usstamp

Connection to UserVO, permission user

[AttForeignKey(typeof(UserVO), HiddenField = false)]
[AttLenght(25)]
public string usstamp { get; set; }

Property Value

string

variables

Global variables

[AttCollection(typeof(BPMVariableVO))]
public List<BPMVariableVO> variables { get; set; }

Property Value

List<BPMVariableVO>

version

Version, only increment when isdraft = false

[AttLenght(10)]
[AttFieldType(AttFieldType.InputTypes.integer, new AttFieldType.FieldFlags[] { AttFieldType.FieldFlags.isReadOnly })]
public decimal version { get; set; }

Property Value

decimal

Methods

GetAction(string)

public BPMActionVO GetAction(string uniqueID)

Parameters

Nome Tipo Descrição
uniqueID string

Returns

BPMActionVO

GetElement(string)

public BPMElement GetElement(string uniqueID)

Parameters

Nome Tipo Descrição
uniqueID string

Returns

BPMElement

GetElement<T>(string)

public T GetElement<T>(string uniqueID) where T : BPMElement

Parameters

Nome Tipo Descrição
uniqueID string

Returns

T

Type Parameters

T

GetEvent(string)

public BPMEventVO GetEvent(string uniqueID)

Parameters

Nome Tipo Descrição
uniqueID string

Returns

BPMEventVO

GetFlow(string)

public BPMFlowVO GetFlow(string uniqueID)

Parameters

Nome Tipo Descrição
uniqueID string

Returns

BPMFlowVO

GetGateway(string)

public BPMGatewayVO GetGateway(string uniqueID)

Parameters

Nome Tipo Descrição
uniqueID string

Returns

BPMGatewayVO

SetStampValue(string)

public override void SetStampValue(string stampID)

Parameters

Nome Tipo Descrição
stampID string

SignStatusChanged()

public bool SignStatusChanged()

Returns

bool

WillSignNow()

public bool WillSignNow()

Returns

bool

Explicit Interface Implementations

isdraft

Draft mode is the only one that allows you to enter drawing mode

[AttFieldType(new AttFieldType.FieldFlags[] { AttFieldType.FieldFlags.isReadOnly })]
bool isdraft { get; set; }

Returns

bool